Gcloud::Datastore::Dataset::LookupResults

LookupResults is a special case Array with additional values. A LookupResults object is returned from Gcloud::Datastore::Dataset#find_all and contains the entities as well as the Keys that were deferred from the results and the Entities that were missing in the dataset.

entities = dataset.find_all key1, key2, key3
entities.size #=> 3
entities.deferred #=> []
entities.missing #=> []

Please be cautious when treating the LookupResults as an Array. Many common Array methods will return a new Array instance.

entities = dataset.find_all key1, key2, key3
entities.size #=> 3
entities.deferred #=> []
entities.missing #=> []
names = entities.map { |e| e["name"] }
names.size #=> 3
names.deferred #=> NoMethodError
names.missing #=> NoMethodError

Methods

Attributes

deferred [RW]

Keys that were not looked up due to resource constraints.

missing [RW]

Entities not found, with only the key populated.

Public Class Methods

new(arr = [], deferred = [], missing = [])

Create a new LookupResults with an array of values.