Module: Dynamoid::Indexes

Extended by:
ActiveSupport::Concern
Included in:
Components
Defined in:
lib/dynamoid/indexes.rb,
lib/dynamoid/indexes/index.rb

Overview

Indexes are quick ways of performing queries by anything other than id in DynamoDB. They are denormalized tables; that is, data is duplicated in the initial table (where the object is saved) and the index table (where we perform indexing).

Defined Under Namespace

Modules: ClassMethods Classes: Index

Instance Method Summary collapse

Instance Method Details

#delete_indexesObject

Callback for an object to delete itself from each of a class' indexes.

Since:

  • 0.2.0



62
63
64
65
66
# File 'lib/dynamoid/indexes.rb', line 62

def delete_indexes
  self.class.indexes.each do |name, index|
    index.delete(self)
  end
end

#save_indexesObject

Callback for an object to save itself to each of a class' indexes.

Since:

  • 0.2.0



53
54
55
56
57
# File 'lib/dynamoid/indexes.rb', line 53

def save_indexes
  self.class.indexes.each do |name, index|
    index.save(self)
  end
end