Send feedback
Cloud Firestore Client - Class AggregateQuery (1.47.3) Stay organized with collections
Save and categorize content based on your preferences.
Version 1.47.3 keyboard_arrow_down
Reference documentation and code samples for the Cloud Firestore Client class AggregateQuery.
A Cloud Firestore Aggregate Query.
Example:
use Google\Cloud\Firestore\FirestoreClient;
$firestore = new FirestoreClient();
$collection = $firestore->collection('users');
$query = $collection->where('age', '>', 18)->count();
Namespace
Google \ Cloud \ Firestore
Methods
__construct
Create an aggregation query.
connection
Connection\ConnectionInterface
A Connection to Cloud Firestore.
This object is created by FirestoreClient,
and should not be instantiated outside of this client.
parent
string
The parent of the query.
query
array
Represents the underlying structured query.
aggregate
Aggregate
Aggregation over the provided query.
addAggregation
Adds provided aggregation to AggregateQuery.
aggregate
Aggregate
Aggregate properties to be applied over query.
getSnapshot
Executes the AggregateQuery.
options
array
Configuration options is an array.
↳ readTime
Timestamp
Reads entities as they were at the given timestamp.
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-30 UTC."],[],[]]