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

Namespace

Google \ Cloud \ Firestore

Methods

__construct

An immutable snapshot of aggregate query results.

Parameter
Name
Description
snapshot
array

Result of an AggregateQuery.

getTransaction

Get the transaction id.

Returns
Type
Description
string

getReadTime

Get the Aggregation read time.

Returns
Type
Description

getExplainMetrics

Gets ExplainMetrics when the explainOptions option is supplied.

If ExplainOptions::setAnalyze is set to false , the query is planned and not executed, returning only the V1\PlanSummary instead of the V1\ExecutionStats and result.

Returns
Type
Description

get

Get the Query Aggregation value.

Parameter
Name
Description
alias
string

The aggregation alias.

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