# Cloud Firestore Client - Class AggregateQuerySnapshot (2.2.0-RC1)

2.2.0-RC1 2.1.0 (latest) 2.0.2-RC1 1.55.0 1.54.4 1.53.1 1.52.0 1.51.0 1.50.0 1.48.1 1.47.3 1.46.0 1.45.2 1.44.1 1.43.3 1.40.0 1.39.0 1.38.0 1.37.7 1.36.1 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.28.0 1.27.3 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** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-core/latest/Timestamp.html` |   |

### 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](https://docs.cloud.google.com/php/docs/reference/cloud-firestore/latest/V1.PlanSummary)
instead of the [V1\\ExecutionStats](https://docs.cloud.google.com/php/docs/reference/cloud-firestore/latest/V1.ExecutionStats) and result.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `null|https://docs.cloud.google.com/php/docs/reference/cloud-firestore/latest/V1.ExplainMetrics` |   |

### get

Get the Query Aggregation value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `alias` | `string` The aggregation alias. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `mixed` |   |