Reference documentation and code samples for the Firestore v1 API class AggregationResult.
The result of a single bucket from a Firestore aggregation query.
The keys of aggregate_fields are the same for all results in an aggregation
query, unlike document queries which can have different fields present for
each result.
The result of the aggregation functions, ex: COUNT(*) AS total_docs.
The key is the
[alias][google.firestore.v1.StructuredAggregationQuery.Aggregation.alias]
assigned to the aggregation function on input and the size of this map
equals the number of aggregation functions in the query.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis page provides reference documentation for the \u003ccode\u003eAggregationResult\u003c/code\u003e class within the Firestore v1 API, specifically version 3.8.0, as well as links to other versions.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAggregationResult\u003c/code\u003e is used to represent the output of a single bucket from a Firestore aggregation query, where the keys of \u003ccode\u003eaggregate_fields\u003c/code\u003e remain consistent across all results.\u003c/p\u003e\n"],["\u003cp\u003eThe class implements multiple interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, and inherits from the base \u003ccode\u003eobject\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAggregateFields\u003c/code\u003e property, a \u003ccode\u003eMapField\u003c/code\u003e of strings and \u003ccode\u003eValue\u003c/code\u003e types, holds the results of the aggregation functions, with keys matching the aliases defined in the query.\u003c/p\u003e\n"],["\u003cp\u003eConstructors are included for both a default instance, \u003ccode\u003eAggregationResult()\u003c/code\u003e, and one that copies properties from another \u003ccode\u003eAggregationResult\u003c/code\u003e instance, \u003ccode\u003eAggregationResult(AggregationResult other)\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]