Cloud Firestore Client - Class Aggregate (1.31.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());

Methods

count

Creates count aggregation properties.

Example:

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

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