[[["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-08-07 UTC."],[[["\u003cp\u003eThis document provides reference information for the \u003ccode\u003eAggregationQuery\u003c/code\u003e class within the Google Cloud Datastore v1 API, specifically for .NET development, covering versions from 3.2.0 up to the latest 4.15.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAggregationQuery\u003c/code\u003e class is designed for running aggregations over a Datastore query, allowing users to perform operations on data subsets, implementing the \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e interfaces.\u003c/p\u003e\n"],["\u003cp\u003eConstructors for the \u003ccode\u003eAggregationQuery\u003c/code\u003e class allow for the creation of instances either empty, as a copy of an existing instance, or with a specified \u003ccode\u003eQuery\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of \u003ccode\u003eAggregationQuery\u003c/code\u003e include \u003ccode\u003eAggregations\u003c/code\u003e, which is a collection for defining aggregation operations, limited to a minimum of one and a maximum of five per query, and \u003ccode\u003eNestedQuery\u003c/code\u003e, which specifies the query for the aggregation.\u003c/p\u003e\n"],["\u003cp\u003eIt also includes \u003ccode\u003eQueryTypeCase\u003c/code\u003e property, to provide information about the query type.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Datastore v1 API - Class AggregationQuery (4.15.0)\n\nVersion latestkeyboard_arrow_down\n\n- [4.15.0 (latest)](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQuery)\n- [4.14.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.14.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [4.13.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.13.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [4.12.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.12.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [4.11.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.11.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [4.10.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.10.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [4.9.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.9.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [4.8.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.8.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [4.7.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.7.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.6.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.5.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.4.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.3.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.2.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.1.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.0.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/3.5.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/3.4.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/3.3.0/Google.Cloud.Datastore.V1.AggregationQuery)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/3.2.0/Google.Cloud.Datastore.V1.AggregationQuery) \n\n public sealed class AggregationQuery : IMessage\u003cAggregationQuery\u003e, IEquatable\u003cAggregationQuery\u003e, IDeepCloneable\u003cAggregationQuery\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Datastore v1 API class AggregationQuery.\n\nDatastore query for running an aggregation over a\n\\[Query\\]\\[google.datastore.v1.Query\\]. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e AggregationQuery \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[AggregationQuery](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQuery), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AggregationQuery](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQuery), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[AggregationQuery](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQuery), [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.Datastore.V1](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Datastore.V1.dll\n\nConstructors\n------------\n\n### AggregationQuery()\n\n public AggregationQuery()\n\n### AggregationQuery(AggregationQuery)\n\n public AggregationQuery(AggregationQuery other)\n\n### AggregationQuery(Query)\n\n public AggregationQuery(Query query)\n\nConstructs an instance of [AggregationQuery](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationQuery) for the given [Query](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.Query).\n\nProperties\n----------\n\n### Aggregations\n\n public RepeatedField\u003cAggregationQuery.Types.Aggregation\u003e Aggregations { get; }\n\nOptional. Series of aggregations to apply over the results of the\n`nested_query`.\n\nRequires:\n\n- A minimum of one and maximum of five aggregations per query.\n\n### NestedQuery\n\n public Query NestedQuery { get; set; }\n\nNested query for aggregation\n\n### QueryTypeCase\n\n public AggregationQuery.QueryTypeOneofCase QueryTypeCase { get; }"]]