lib/dynamoid/finders.rb
def find_all_by_composite_key(hash_key, options = {})
        Dynamoid.adapter.query(self.table_name, options.merge({hash_value: hash_key})).collect do |item|
          from_database(item)
        end
      end
# Find all objects by hash and range keys.
#
# @example find all ChamberTypes whose level is greater than 1
#   class ChamberType
#     include Dynamoid::Document
#     field :chamber_type,            :string
#     range :level,                   :integer
#     table :key => :chamber_type
#   end
#   ChamberType.find_all_by_composite_key('DustVault', range_greater_than: 1)
#
# @param [String] hash_key of the objects to find
# @param [Hash] options the options for the range key
# @option options [Range] :range_value find the range key within this range
# @option options [Number] :range_greater_than find range keys greater than this
# @option options [Number] :range_less_than find range keys less than this
# @option options [Number] :range_gte find range keys greater than or equal to this
# @option options [Number] :range_lte find range keys less than or equal to this
#
# @return [Array] an array of all matching items
#
Find all objects by hash and range keys.
Find all objects by hash and range keys .
def find_all_by_composite_key(hash_key, options = {})
        Dynamoid.adapter.query(self.table_name, options.merge({hash_value: hash_key})).collect do |item|
          from_database(item)
        end
      end
def find_all_by_composite_key ( hash_key , options = { } ) Dynamoid . adapter . query ( self . table_name , options . merge ( { hash_value : hash_key } ) ) . collect do | item | from_database ( item ) end end
Find all objects by hash and range keys.
Find all objects by hash and range keys .
an array of all matching items
an array of all matching items
Array
hash_key
options
:range_lte find range keys less than or equal to this
: range_lte find range keys less than or equal to this
options the options for the range key
options the options for the range key
example
find all ChamberTypes whose level is greater than 1 class ChamberType include Dynamoid::Document field :chamber_type, :string range :level, :integer table :key => :chamber_type end ChamberType.find_all_by_composite_key('DustVault', range_greater_than: 1)
find all ChamberTypes whose level is greater than 1 class ChamberType include Dynamoid :: Document field : chamber_type : string range : level : integer table : key = > : chamber_type end ChamberType . find_all_by_composite_key ( ' DustVault ' range_greater_than : 1 )