Class: Google::Apis::DatastoreV1::AggregationQuery

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/datastore_v1/classes.rb,
lib/google/apis/datastore_v1/representations.rb,
lib/google/apis/datastore_v1/representations.rb

Overview

Datastore query for running an aggregation over a Query.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ AggregationQuery

Returns a new instance of AggregationQuery.



104
105
106
# File 'lib/google/apis/datastore_v1/classes.rb', line 104

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#aggregationsArray<Google::Apis::DatastoreV1::Aggregation>

Optional. Series of aggregations to apply over the results of the nested_query. Requires: * A minimum of one and maximum of five aggregations per query. Corresponds to the JSON property aggregations



95
96
97
# File 'lib/google/apis/datastore_v1/classes.rb', line 95

def aggregations
  @aggregations
end

#nested_queryGoogle::Apis::DatastoreV1::Query

A query for entities. The query stages are executed in the following order: 1. kind 2. filter 3. projection 4. order + start_cursor + end_cursor 5. offset 6. limit 7. find_nearest Corresponds to the JSON property nestedQuery



102
103
104
# File 'lib/google/apis/datastore_v1/classes.rb', line 102

def nested_query
  @nested_query
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



109
110
111
112
# File 'lib/google/apis/datastore_v1/classes.rb', line 109

def update!(**args)
  @aggregations = args[:aggregations] if args.key?(:aggregations)
  @nested_query = args[:nested_query] if args.key?(:nested_query)
end