Class: Google::Apis::FirestoreV1beta1::Aggregation

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

Overview

Defines a 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.



42
43
44
# File 'lib/google/apis/firestore_v1beta1/classes.rb', line 42

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

Instance Attribute Details

#aliasString

Required. The name of the field to store the result of the aggregation into. Requires: * Must be present. * Must be unique across all aggregation aliases. * Conform to existing document field name limitations. Corresponds to the JSON property alias

Returns:

  • (String)


34
35
36
# File 'lib/google/apis/firestore_v1beta1/classes.rb', line 34

def alias
  @alias
end

#countGoogle::Apis::FirestoreV1beta1::Count

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



40
41
42
# File 'lib/google/apis/firestore_v1beta1/classes.rb', line 40

def count
  @count
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



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

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