Google Cloud Datastore v1 API - Class Aggregations (4.12.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
Name Description
property string

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

alias string

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
Type Description
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
Name Description
alias string

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
Type Description
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
Name Description
property string

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

alias string

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
Type Description
AggregationQueryTypesAggregation

A sum aggregation for the specified property.