Cloud Firestore Client - Class Aggregate (1.35.0)

Reference documentation and code samples for the Cloud Firestore Client class Aggregate.

Represents Aggregate properties.

Example:

$count = Aggregate::count();
$count->alias('count');

echo json_encode($count->getProps());

Namespace

Google \ Cloud \ Firestore

Methods

alias

Set the aggregate alias.

Example:

$count = Aggregate->count();
$count->alias('total');

echo $count->props()['alias'];
Parameter
NameDescription
alias string

The alias for aggregate.

Returns
TypeDescription
Google\Cloud\Firestore\Aggregate

getProps

Get the array representation for the aggregate.

Returns
TypeDescription
array

static::count

Creates count aggregation properties.

Example:

$count = Aggregate::count();
Returns
TypeDescription
Google\Cloud\Firestore\Aggregate