Cloud Datastore Client - Class Aggregation (1.21.2)

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()); 

Methods

count

Creates count aggregation properties.

Example:

 $count = Aggregation::count(); 
Returns
Type
Description

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

getProps

Get the array representation for the aggregation.

Returns
Type
Description
array
Design a Mobile Site
View Site in Mobile | Classic
Share by: