Class AWS::DynamoDB::BatchGet
In: lib/aws/dynamo_db/batch_get.rb
Parent: Object

A utility class for configuring a list of tables, attributes and items to request information for.

@see DynamoDB#batch_get @see Table#batch_get

Methods

Included Modules

Keys Enumerable Core::Model

Public Class methods

Public Instance methods

Yields only attribute hashes. This removes the outer hash that normally provides the :table_name and :attributes keys. This is useful when your batch get requested items from a single table.

Specify a list of {Item} objects to batch fetch attributes for. The table name is retrieved from the items objects, this means the items do not need to belong to the same table.

@param [Symbol, String, Array<String>] attributes The list of attributes

  to fetch.  If you want to load *ALL* attributes for the named items,
  then pass the symbol +:all+.

    # get all attributes
    batch_get.table('mytable', :all, items)

    # get one attribute for each item
    batch_get.table('mytable', ['name'], items)

    # get a list of attributes for each item
    batch_get.table('mytable', ['name', 'size'], items)

@param [Item] items One or more {Item} objects to fetch attributes

  for.  These items may come from any number of different tables.

Add a list of items to fetch in this batch.

@param [String] table_name The name of the table to fetch attributes

  from.

@param [Symbol, String, Array<String>] attributes The list of attributes

  to fetch.  If you want to load *ALL* attributes for the named items,
  then pass the symbol +:all+.

    # get all attributes
    batch_get.table('mytable', :all, items)

    # get one attribute for each item
    batch_get.table('mytable', ['name'], items)

    # get a list of attributes for each item
    batch_get.table('mytable', ['name', 'size'], items)

@param [Array<Item,Array>] items One or more items to fetch attributes

  for.  Each attribute should be one of the following:

  * an {Item} object
  * a hash key value
  * a hash key value and a range key value

  You must provide both the hash key and range key values if the table
  schema has both.

    batch_get.table('mytable', :all, [%w(hk1 rk1), %w(hk1 rk2), ...])

@return [nil]

Protected Instance methods

[Validate]