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\u003eThe latest version of the \u003ccode\u003eAggregationResult\u003c/code\u003e class is 3.10.0, representing the most current release within the Google.Cloud.Firestore.V1 namespace.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAggregationResult\u003c/code\u003e is a class within the Firestore v1 API, representing the output of a single bucket from a Firestore aggregation query.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAggregationResult\u003c/code\u003e class implements interfaces such as \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, showcasing its capabilities within the .NET framework.\u003c/p\u003e\n"],["\u003cp\u003eThe class offers properties such as \u003ccode\u003eAggregateFields\u003c/code\u003e, which is a map where the keys represent the aliases of aggregation functions and the values represent the result of those aggregation functions.\u003c/p\u003e\n"],["\u003cp\u003eThe class also offers the following constructors: \u003ccode\u003eAggregationResult()\u003c/code\u003e, and \u003ccode\u003eAggregationResult(AggregationResult other)\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Firestore v1 API - Class AggregationResult (3.10.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.10.0 (latest)](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.AggregationResult)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.9.0/Google.Cloud.Firestore.V1.AggregationResult)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.8.0/Google.Cloud.Firestore.V1.AggregationResult)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.7.0/Google.Cloud.Firestore.V1.AggregationResult)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.6.0/Google.Cloud.Firestore.V1.AggregationResult)\n- [3.5.1](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.5.1/Google.Cloud.Firestore.V1.AggregationResult)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.4.0/Google.Cloud.Firestore.V1.AggregationResult)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.3.0/Google.Cloud.Firestore.V1.AggregationResult)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.2.0/Google.Cloud.Firestore.V1.AggregationResult)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.1.0/Google.Cloud.Firestore.V1.AggregationResult)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.0.0/Google.Cloud.Firestore.V1.AggregationResult)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/2.5.0/Google.Cloud.Firestore.V1.AggregationResult)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/2.4.0/Google.Cloud.Firestore.V1.AggregationResult)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/2.3.0/Google.Cloud.Firestore.V1.AggregationResult) \n\n public sealed class AggregationResult : IMessage\u003cAggregationResult\u003e, IEquatable\u003cAggregationResult\u003e, IDeepCloneable\u003cAggregationResult\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Firestore v1 API class AggregationResult.\n\nThe result of a single bucket from a Firestore aggregation query.\n\nThe keys of `aggregate_fields` are the same for all results in an aggregation\nquery, unlike document queries which can have different fields present for\neach result. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e AggregationResult \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[AggregationResult](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.AggregationResult), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AggregationResult](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.AggregationResult), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[AggregationResult](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.AggregationResult), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Firestore.V1](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Firestore.V1.dll\n\nConstructors\n------------\n\n### AggregationResult()\n\n public AggregationResult()\n\n### AggregationResult(AggregationResult)\n\n public AggregationResult(AggregationResult other)\n\nProperties\n----------\n\n### AggregateFields\n\n public MapField\u003cstring, Value\u003e AggregateFields { get; }\n\nThe result of the aggregation functions, ex: `COUNT(*) AS total_docs`.\n\nThe key is the\n\\[alias\\]\\[google.firestore.v1.StructuredAggregationQuery.Aggregation.alias\\]\nassigned to the aggregation function on input and the size of this map\nequals the number of aggregation functions in the query."]]