# Cloud Firestore V1 API - Class Google::Cloud::Firestore::V1::AggregationResult (v2.4.0)

2.4.0 (latest) 2.3.0 2.2.1 2.1.1 2.0.1 1.3.0 1.2.0 1.1.1 1.0.0 0.14.0 0.13.0 0.12.0 0.11.1 0.10.0 0.9.0 0.8.0 0.7.1 0.6.0 0.5.0 0.4.8 Reference documentation and code samples for the Cloud Firestore V1 API class Google::Cloud::Firestore::V1::AggregationResult.

The result of a single bucket from a Firestore aggregation query.


<br />

The keys of `aggregate_fields` are the same for all results in an aggregation
query, unlike document queries which can have different fields present for
each result.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #aggregate_fields

    def aggregate_fields() -> ::Google::Protobuf::Map{::String => ::Google::Cloud::Firestore::V1::Value}

**Returns**

- (::Google::Protobuf::Map{::String =\> ::Google::Cloud::Firestore::V1::Value}) --- The result of the aggregation functions, ex: `COUNT(*) AS total_docs`.


  The key is the
  [alias](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-StructuredAggregationQuery-Aggregation#Google__Cloud__Firestore__V1__StructuredAggregationQuery__Aggregation_alias_instance_ "Google::Cloud::Firestore::V1::StructuredAggregationQuery::Aggregation#alias (method)")
  assigned to the aggregation function on input and the size of this map
  equals the number of aggregation functions in the query.

### #aggregate_fields=

    def aggregate_fields=(value) -> ::Google::Protobuf::Map{::String => ::Google::Cloud::Firestore::V1::Value}

**Parameter**

- **value** (::Google::Protobuf::Map{::String =\> ::Google::Cloud::Firestore::V1::Value}) --- The result of the aggregation functions, ex: `COUNT(*) AS total_docs`.


  The key is the
  [alias](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-StructuredAggregationQuery-Aggregation#Google__Cloud__Firestore__V1__StructuredAggregationQuery__Aggregation_alias_instance_ "Google::Cloud::Firestore::V1::StructuredAggregationQuery::Aggregation#alias (method)")
  assigned to the aggregation function on input and the size of this map
  equals the number of aggregation functions in the query.
**Returns**

- (::Google::Protobuf::Map{::String =\> ::Google::Cloud::Firestore::V1::Value}) --- The result of the aggregation functions, ex: `COUNT(*) AS total_docs`.


  The key is the
  [alias](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-StructuredAggregationQuery-Aggregation#Google__Cloud__Firestore__V1__StructuredAggregationQuery__Aggregation_alias_instance_ "Google::Cloud::Firestore::V1::StructuredAggregationQuery::Aggregation#alias (method)")
  assigned to the aggregation function on input and the size of this map
  equals the number of aggregation functions in the query.