Class: Rom::Dynamo::BatchGetDataset

Inherits:
Dataset
  • Object
show all
Defined in:
lib/rom/dynamo/dataset.rb

Overview

Batch get using an array of key queries

{ key => val }, { key => val }, …

Constant Summary

Constants inherited from Dataset

Dataset::EmptyQuery

Instance Method Summary collapse

Methods inherited from Dataset

#batch_restrict, #delete, #each, #index_restrict, #insert, #limit, #offset, #restrict, #reversed, #update

Instance Method Details

#each_page(&block) ⇒ Object

Query for records



162
163
164
165
166
167
168
# File 'lib/rom/dynamo/dataset.rb', line 162

def each_page(&block)
  return enum_for(:each_page) if block.nil?
  batch_get_each_page(@keys) do |items|
    klass = Aws::DynamoDB::Types::QueryOutput
    block.call(klass.new(items: items, count: items.size))
  end
end