class StatelyDB::Transaction::Transaction

def get_batch(*key_paths)

Raises:
  • (StatelyDB::Error::NotFound) - if the item is not found
  • (StatelyDB::Error::InvalidParameters) - if the parameters are invalid

Returns:
  • (Array) - the items

Parameters:
  • key_paths (String, Array) -- the paths to the items. Max 100
def get_batch(*key_paths)
  key_paths = Array(key_paths).flatten
  req = Stately::Db::TransactionRequest.new(
    get_items: Stately::Db::TransactionGet.new(
      gets: key_paths.map { |key_path| Stately::Db::GetItem.new(key_path: String(key_path)) }
    )
  )
  resp = request_response(req).get_results
  resp.items.map do |result|
    @schema.unmarshal_item(stately_item: result)
  end
end