Google Cloud Datastore v1 API - Class Aggregations (4.8.0)

public static class Aggregations

Reference documentation and code samples for the Google Cloud Datastore v1 API class Aggregations.

Factory for different types of Aggregations.

Inheritance

object > Aggregations

Namespace

Google.Cloud.Datastore.V1

Assembly

Google.Cloud.Datastore.V1.dll

Methods

Average(string, string)

public static AggregationQuery.Types.Aggregation Average(string property, string alias = "")

Returns an instance of an average aggregation for the specified property.

Parameters
NameDescription
propertystring

Property for which the average is to be calculated. Must not be null.

aliasstring

A string used to retrieve the result of this aggregation. If this is not provided, Datastore will pick a default name with a prefix of property_ followed by an auto-incremented ID, e.g. property_1.

Returns
TypeDescription
AggregationQueryTypesAggregation

An average aggregation for the specified property.

Count(string)

public static AggregationQuery.Types.Aggregation Count(string alias = "")

Returns an instance of count(*) aggregation.

Parameter
NameDescription
aliasstring

A string used to retrieve the result of this aggregation. If this is not provided, Datastore will pick a default name with a prefix of property_ followed by an auto-incremented ID, e.g. property_1.

Returns
TypeDescription
AggregationQueryTypesAggregation

A count(*) aggregation.

Sum(string, string)

public static AggregationQuery.Types.Aggregation Sum(string property, string alias = "")

Returns an instance of a sum aggregation for the specified property.

Parameters
NameDescription
propertystring

Property for which the sum is to be calculated. Must not be null.

aliasstring

A string used to retrieve the result of this aggregation. If this is not provided, Datastore will pick a default name with a prefix of property_ followed by an auto-incremented ID, e.g. property_1.

Returns
TypeDescription
AggregationQueryTypesAggregation

A sum aggregation for the specified property.