Cloud Firestore Client - Class AggregateQuerySnapshot (1.30.0)

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

Represents the result set of an AggregateQuery.

Example:

use Google\Cloud\Firestore\FirestoreClient;

$firestore = new FirestoreClient();
$collection = $firestore->collection('users');
$query = $collection->where('age', '>', 18);

$snapshot = $query->count();

Methods

__construct

An immutable snapshot of aggregate query results.

Parameter
NameDescription
snapshot array

Result of an AggregateQuery.

getTransaction

Get the transaction id.

Returns
TypeDescription
string

getReadTime

Get the Aggregation read time.

Returns
TypeDescription
Google\Cloud\Core\Timestamp

get

Get the Query Aggregation value.

Parameter
NameDescription
alias string

The aggregation alias.

Returns
TypeDescription
int