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 \ FirestoreMethods
alias
Set the aggregate alias.
Example:
$count = Aggregate->count();
$count->alias('total');
echo $count->props()['alias'];
Parameter | |
---|---|
Name | Description |
alias |
string
The alias for aggregate. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Firestore\Aggregate |
getProps
Get the array representation for the aggregate.
Returns | |
---|---|
Type | Description |
array |
static::count
Creates count aggregation properties.
Example:
$count = Aggregate::count();
Returns | |
---|---|
Type | Description |
Google\Cloud\Firestore\Aggregate |