Count, sum, average, min or max over a collection, filtered with the
same `where` a query takes and optionally grouped by one field, in
one request. It runs on each document's indexed projection (its
top-level string / number / boolean / null fields), never on the
bodies: a nested value does not exist to it, a string longer than 256
characters groups by its first 256 and the answer says
`key_truncated` when that happened, and at most 100 groups come back,
largest first (`groups_truncated`). A read carrying a body, hence a
POST on a literal sub-path; `aggregate` is a reserved document id.
This is the last operation the query surface takes. A store is a
Firestore-shaped document store: filter, order, page and aggregate on
top-level fields. No joins, nested-field filters, full-text search or
SQL follow; a customer who needs more brings their own database
through a webhook or MCP tool, or pulls a collection into a run's
sandbox.
Dark launch: requires the `hosted_apis_access` entitlement (402 `hosted_apis_not_in_plan` otherwise).
Request
This endpoint expects an object.
metricslist of objectsRequired
wherelist of objectsOptional
Filters, ANDed, the same ones a query takes.
group_bystringOptionalformat: "^[A-Za-z_][A-Za-z0-9_]{0,63}$"<=64 characters
One projected field to group by. A string that reaches the index’s 256-byte limit may have been cut there, and the answer says so.