Reference documentation and code samples for the Cloud Datastore Client class Aggregation.
Represents Count Aggregation properties.
Example:
$count = Aggregation::count();
$count->alias('count');
$count->limit(100);
echo json_encode($count->getProps());
Namespace
Google \ Cloud \ Datastore \ QueryMethods
alias
Set the aggregation alias.
Example:
$count = Aggregation->count();
$count->alias('total');
echo $count->props()['count']['alias'];
Parameter | |
---|---|
Name | Description |
alias |
string
The alias for aggregation. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Datastore\Query\Aggregation |
getProps
Get the array representation for the aggregation.
Returns | |
---|---|
Type | Description |
array |
static::count
Creates count aggregation properties.
Example:
$count = Aggregation::count();
Returns | |
---|---|
Type | Description |
Google\Cloud\Datastore\Query\Aggregation |