lib/dynamoid/criteria/chain.rb
# If the query does not match an index, we'll manually scan the associated table to find results.
#
# @return [Array] an array of the found records.
#
# @since 0.2.0
If the query does not match an index, we'll manually scan the associated table to find results.
If the query does not match an index we ' ll manually scan the associated table to find results .
def records_without_index
        if Dynamoid::Config.warn_on_scan
          Dynamoid.logger.warn 'Queries without an index are forced to use scan and are generally much slower than indexed queries!'
          Dynamoid.logger.warn "You can index this query by adding this to #{source.to_s.downcase}.rb: index [#{source.attributes.sort.collect{|attr| ":#{attr}"}.join(', ')}]"
        end
        if @consistent_read
          raise Dynamoid::Errors::InvalidQuery, 'Consistent read is not supported by SCAN operation'
        end
        Dynamoid::Adapter.scan(source.table_name, query, query_opts).collect {|hash| source.from_database(hash) }
      end
def records_without_index if Dynamoid :: Config . warn_on_scan Dynamoid . logger . warn 'Queries without an index are forced to use scan and are generally much slower than indexed queries!' Dynamoid . logger . warn "You can index this query by adding this to #{source.to_s.downcase}.rb: index [#{source.attributes.sort.collect{|attr| ":#{attr}"}.join(', ')}]" end if @consistent_read raise Dynamoid :: Errors :: InvalidQuery , 'Consistent read is not supported by SCAN operation' end Dynamoid :: Adapter . scan ( source . table_name , query , query_opts ) . collect { | hash | source . from_database ( hash ) } end
If the query does not match an index, we'll manually scan the associated table to find results.
If the query does not match an index we ' ll manually scan the associated table to find results .
an array of the found records.
an array of the found records .
Array
since
None