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 \ FirestoreMethods
__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 |
Google\Cloud\Core\Timestamp |
|
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 |
null|V1\ExplainMetrics |
|
get
Get the Query Aggregation value.
| Parameter | |
|---|---|
| Name | Description |
alias |
string
The aggregation alias. |
| Returns | |
|---|---|
| Type | Description |
mixed |
|