[[["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 \u003ccode\u003eAggregateQuery\u003c/code\u003e class in the Google.Cloud.Firestore API allows for running server-side aggregations on Firestore data.\u003c/p\u003e\n"],["\u003cp\u003eThis class is created using methods like \u003ccode\u003eCount()\u003c/code\u003e and \u003ccode\u003eAggregate()\u003c/code\u003e within the \u003ccode\u003eQuery\u003c/code\u003e class, and it implements the \u003ccode\u003eIEquatable\u003c/code\u003e interface.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eExplainAsync()\u003c/code\u003e method provides an explanation of the query, and \u003ccode\u003eGetSnapshotAsync()\u003c/code\u003e takes a snapshot of the result after applying the aggregate functions.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of this class is 3.10.0, with previous versions ranging back to 2.3.1 listed.\u003c/p\u003e\n"]]],[],null,["# Firestore API - Class AggregateQuery (3.10.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.10.0 (latest)](/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.AggregateQuery)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.9.0/Google.Cloud.Firestore.AggregateQuery)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.8.0/Google.Cloud.Firestore.AggregateQuery)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.7.0/Google.Cloud.Firestore.AggregateQuery)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.6.0/Google.Cloud.Firestore.AggregateQuery)\n- [3.5.1](/dotnet/docs/reference/Google.Cloud.Firestore/3.5.1/Google.Cloud.Firestore.AggregateQuery)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.4.0/Google.Cloud.Firestore.AggregateQuery)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.3.0/Google.Cloud.Firestore.AggregateQuery)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.2.0/Google.Cloud.Firestore.AggregateQuery)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.1.0/Google.Cloud.Firestore.AggregateQuery)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.0.0/Google.Cloud.Firestore.AggregateQuery)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Firestore/2.5.0/Google.Cloud.Firestore.AggregateQuery)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Firestore/2.4.0/Google.Cloud.Firestore.AggregateQuery)\n- [2.3.1](/dotnet/docs/reference/Google.Cloud.Firestore/2.3.1/Google.Cloud.Firestore.AggregateQuery) \n\n public sealed class AggregateQuery : IEquatable\u003cAggregateQuery\u003e\n\nReference documentation and code samples for the Firestore API class AggregateQuery.\n\nA query for running server-side aggregations. Instances of this can be created using\n[Count()](/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.Query#Google_Cloud_Firestore_Query_Count) and [Aggregate(AggregateField, params AggregateField\\[\\])](/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.Query#Google_Cloud_Firestore_Query_Aggregate_Google_Cloud_Firestore_AggregateField_Google_Cloud_Firestore_AggregateField___). \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e AggregateQuery \n\nImplements\n----------\n\n[IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AggregateQuery](/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.AggregateQuery) \n\nInherited Members\n-----------------\n\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](/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore)\n\nAssembly\n--------\n\nGoogle.Cloud.Firestore.dll\n\nMethods\n-------\n\n### ExplainAsync(ExplainOptions, CancellationToken)\n\n public Task\u003cExplainResults\u003cAggregateQuerySnapshot\u003e\u003e ExplainAsync(ExplainOptions options, CancellationToken cancellationToken = default)\n\nReturns an explanation for this query, optionally executing it.\n\n### GetHashCode()\n\n public override int GetHashCode()\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### GetSnapshotAsync(CancellationToken)\n\n public Task\u003cAggregateQuerySnapshot\u003e GetSnapshotAsync(CancellationToken cancellationToken = default)\n\nAsynchronously takes a snapshot of the result after applying the aggregate functions on the query."]]