class StatelyDB::CoreClient

def get_batch(*key_paths)

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

Returns:
  • (Array, NilClass) - the items or nil if not found

Parameters:
  • key_paths (String, Array) -- the paths to the items. Max 100 key paths.
def get_batch(*key_paths)
  key_paths = Array(key_paths).flatten
  req = Stately::Db::GetRequest.new(
    store_id: @store_id,
    schema_id: @schema::SCHEMA_ID,
    schema_version_id: @schema::SCHEMA_VERSION_ID,
    gets:
      key_paths.map { |key_path| Stately::Db::GetItem.new(key_path: String(key_path)) },
    allow_stale: @allow_stale
  )
  resp = @stub.get(req)
  resp.items.map do |result|
    @schema.unmarshal_item(stately_item: result)
  end
end