Class AggregateField
Represents a single aggregation within an AggregateQuery.
Implements
Namespace: Google.Cloud.Firestore
Assembly: Google.Cloud.Firestore.dll
Syntax
public sealed class AggregateField : IEquatable<AggregateField>
Properties
Alias
The alias for this aggregate field. This is either specified explicitly on construction, or may be defaulted.
Declaration
public string Alias { get; }
Property Value
Type | Description |
---|---|
string |
Methods
Average(string, string)
It uses the server side aggregation Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Avg representing a server-side average aggregation function.
Declaration
public static AggregateField Average(string field, string alias = null)
Parameters
Type | Name | Description |
---|---|---|
string | field | The field on which the average aggregation is performed. Must not be null. |
string | alias | Optional alias to identify the result of the aggregation in AggregateQuerySnapshot. If this is null, an alias of the form "Avg_{field}" is used. |
Returns
Type | Description |
---|---|
AggregateField | Returns a new instance of AggregateField. |
Count()
Creates an AggregateField representing a server-side count aggregation function.
The COUNT(*)
aggregation function operates on the entire document so it does not require a field reference.
Declaration
public static AggregateField Count()
Returns
Type | Description |
---|---|
AggregateField | Returns a new instance of AggregateField. |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
Overrides
Sum(string, string)
Creates an AggregateField representing a server-side sum aggregation function.
Declaration
public static AggregateField Sum(string field, string alias = null)
Parameters
Type | Name | Description |
---|---|---|
string | field | The field on which the sum aggregation is performed. Must not be null. |
string | alias | Optional alias to identify the result of the aggregation in AggregateQuerySnapshot. If this is null, an alias of the form "Sum_{field}" is used. |
Returns
Type | Description |
---|---|
AggregateField | Returns a new instance of AggregateField. |