Class AggregateField (8.2.2)

An AggregateField is a class that contains data that defines an aggregation.

Package

@google-cloud/datastore

Properties

alias_

alias_?: string;

Methods

alias(alias)

alias(alias?: string): AggregateField;

Sets the alias on the aggregate field that should be used.

Parameter
NameDescription
alias string

The label used in the results to describe this aggregate field when a query is run.

Returns
TypeDescription
AggregateField

{AggregateField}

average(property)

static average(property: string): Average;

Gets a copy of the Average aggregate field.

Parameter
NameDescription
property string
Returns
TypeDescription
Average

{Average}

count()

static count(): Count;

Gets a copy of the Count aggregate field.

Returns
TypeDescription
Count

{Count}

sum(property)

static sum(property: string): Sum;

Gets a copy of the Sum aggregate field.

Parameter
NameDescription
property string
Returns
TypeDescription
Sum

{Sum}

toProto()

abstract toProto(): any;

Gets the proto for the aggregate field.

Returns
TypeDescription
any