def all(options = {})
      next_cursor = nil
      query = build_query(options)
      query_results = retry_on_exception { CloudDatastore.dataset.run query }
      if options[:limit]
        next_cursor = query_results.cursor if query_results.size == options[:limit]
        return from_entities(query_results.all), next_cursor
      end
      from_entities(query_results.all)
    end
def all(options = {})
      next_cursor = nil
      query = build_query(options)
      query_results = retry_on_exception { CloudDatastore.dataset.run query }
      if options[:limit]
        next_cursor = query_results.cursor if query_results.size == options[:limit]
        return from_entities(query_results.all), next_cursor
      end
      from_entities(query_results.all)
    end
Queries entities from Cloud Datastore by named kind and using the provided options.
 When a limit option is provided queries up to the limit and returns results with a cursor.

 This method may make several API calls until all query results are retrieved. The `run`
 method returns a QueryResults object, which is a special case Array with additional values.
 QueryResults are returned in batches, and the batch size is determined by the Datastore API.
 Batch size is not guaranteed. It will be affected by the size of the data being returned,
 and by other forces such as how distributed and/or consistent the data in Datastore is.
 Calling `all` on the QueryResults retrieves all results by repeatedly loading #next until
 #next? returns false. The `all` method returns an enumerator which from_entities iterates on.

 Be sure to use as narrow a search criteria as possible. Please use with caution.

 @param [Hash] options The options to construct the query with.

 @option options [Google::Cloud::Datastore::Key] :ancestor Filter for inherited results.
 @option options [String] :cursor Sets the cursor to start the results at.
 @option options [Integer] :limit Sets a limit to the number of results to be returned.
 @option options [String] :order Sort the results by property name.
 @option options [String] :desc_order Sort the results by descending property name.
 @option options [Array] :select Retrieve only select properties from the matched entities.
 @option options [Array] :distinct_on Group results by a list of properties.
 @option options [Array] :where Adds a property filter of arrays in the format
   [name, operator, value].

 @return [Array<Model>, String] An array of ActiveModel results

 or if options[:limit] was provided:

 @return [Array<Model>, String] An array of ActiveModel results and a cursor that
   can be used to query for additional results.