4.6.0 (latest) 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.13.0 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.1 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.5.0 2.4.0 2.3.0

    public sealed class StructuredAggregationQuery.Types.Aggregation : IMessage<StructuredAggregationQuery.Types.Aggregation>, IEquatable<StructuredAggregationQuery.Types.Aggregation>, IDeepCloneable<StructuredAggregationQuery.Types.Aggregation>, IBufferMessage, IMessage

Reference documentation and code samples for the Firestore v1 API class StructuredAggregationQuery.Types.Aggregation.

Defines an aggregation that produces a single result.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> StructuredAggregationQuery.Types.Aggregation

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[StructuredAggregationQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types)[Aggregation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[StructuredAggregationQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types)[Aggregation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[StructuredAggregationQuery](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery)[Types](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types)[Aggregation](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Firestore.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1)

## Assembly

Google.Cloud.Firestore.V1.dll

## Constructors

### Aggregation()

    public Aggregation()

### Aggregation(Aggregation)

    public Aggregation(StructuredAggregationQuery.Types.Aggregation other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQueryhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation` |

## Properties

### Alias

    public string Alias { get; set; }

Optional. Optional name of the field to store the result of the
aggregation into.

If not provided, Firestore will pick a default name following the format
`field_<incremental_id++>`. 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 field_1,
      COUNT_UP_TO(3) AS count_up_to_3,
      COUNT(*) AS field_2
    OVER (
      ...
    );

Requires:

- Must be unique across all aggregation aliases.
- Conform to \[document field name\]\[google.firestore.v1.Document.fields\] limitations.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Avg

    public StructuredAggregationQuery.Types.Aggregation.Types.Avg Avg { get; set; }

Average aggregator.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQueryhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregationhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Avg` |   |

### Count

    public StructuredAggregationQuery.Types.Aggregation.Types.Count Count { get; set; }

Count aggregator.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQueryhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregationhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Count` |   |

### OperatorCase

    public StructuredAggregationQuery.Types.Aggregation.OperatorOneofCase OperatorCase { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQueryhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregationhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.OperatorOneofCase` |   |

### Sum

    public StructuredAggregationQuery.Types.Aggregation.Types.Sum Sum { get; set; }

Sum aggregator.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQueryhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregationhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Sum` |   |