Class: Google::Apis::DatastoreV1beta3::Aggregation

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

Overview

Defines an aggregation that produces a single result.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Aggregation

Returns a new instance of Aggregation.



47
48
49
# File 'lib/google/apis/datastore_v1beta3/classes.rb', line 47

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

Instance Attribute Details

#aliasString

Optional. Optional name of the property to store the result of the aggregation. If not provided, Datastore will pick a default name following the format property_. For example: AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2), COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) OVER ( ... ); becomes: AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2) AS property_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) AS property_2 OVER ( ... ); Requires: * Must be unique across all aggregation aliases. * Conform to entity property name limitations. Corresponds to the JSON property alias

Returns:

  • (String)


39
40
41
# File 'lib/google/apis/datastore_v1beta3/classes.rb', line 39

def alias
  @alias
end

#countGoogle::Apis::DatastoreV1beta3::Count

Count of entities that match the query. The COUNT(*) aggregation function operates on the entire entity so it does not require a field reference. Corresponds to the JSON property count



45
46
47
# File 'lib/google/apis/datastore_v1beta3/classes.rb', line 45

def count
  @count
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



52
53
54
55
# File 'lib/google/apis/datastore_v1beta3/classes.rb', line 52

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