Method: ActiveModel::Datastore::ClassMethods#build_query

Defined in:
lib/active_model/datastore.rb

#build_query(options = {}) ⇒ Query

Constructs a Google::Cloud::Datastore::Query.

Parameters:

  • options (Hash) (defaults to: {})

    The options to construct the query with.

Options Hash (options):

  • :ancestor (Google::Cloud::Datastore::Key)

    Filter for inherited results.

  • :cursor (String)

    Sets the cursor to start the results at.

  • :limit (Integer)

    Sets a limit to the number of results to be returned.

  • :order (String)

    Sort the results by property name.

  • :desc_order (String)

    Sort the results by descending property name.

  • :select (Array)

    Retrieve only select properties from the matched entities.

  • :distinct_on (Array)

    Group results by a list of properties.

  • :where (Array)

    Adds a property filter of arrays in the format [name, operator, value].

Returns:

  • (Query)

    A datastore query.



398
399
400
401
# File 'lib/active_model/datastore.rb', line 398

def build_query(options = {})
  query = CloudDatastore.dataset.query name
  query_options(query, options)
end