Reference documentation and code samples for the Google Cloud Datastore v1 API class AggregationResult.
The result of a single bucket from a Datastore aggregation query.
The keys of aggregate_properties are the same for all results in an
aggregation query, unlike entity queries which can have different fields
present for each result.
The result of the aggregation functions, ex: COUNT(*) AS total_entities.
The key is the
[alias][google.datastore.v1.AggregationQuery.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 webpage provides documentation for the \u003ccode\u003eAggregationResult\u003c/code\u003e class within the Google Cloud Datastore v1 API, detailing its structure and functionality.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAggregationResult\u003c/code\u003e class represents a single bucket's output from a Datastore aggregation query, and it is implemented by being a public sealed class.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version documented for \u003ccode\u003eAggregationResult\u003c/code\u003e is 4.15.0, with versions back to 3.2.0 also having dedicated pages, and the list details the available versions.\u003c/p\u003e\n"],["\u003cp\u003eThe class implements several 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 class \u003ccode\u003eAggregationResult\u003c/code\u003e has two constructors, \u003ccode\u003eAggregationResult()\u003c/code\u003e and \u003ccode\u003eAggregationResult(AggregationResult other)\u003c/code\u003e, and one property, \u003ccode\u003eAggregateProperties\u003c/code\u003e, which is a \u003ccode\u003eMapField\u003c/code\u003e containing the aggregation function results.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Datastore v1 API - Class AggregationResult (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.AggregationResult)\n- [4.14.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.14.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [4.13.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.13.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [4.12.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.12.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [4.11.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.11.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [4.10.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.10.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [4.9.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.9.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [4.8.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.8.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [4.7.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.7.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.6.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.5.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.4.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.3.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.2.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.1.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/4.0.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/3.5.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/3.4.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/3.3.0/Google.Cloud.Datastore.V1.AggregationResult)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Datastore.V1/3.2.0/Google.Cloud.Datastore.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 Google Cloud Datastore v1 API class AggregationResult.\n\nThe result of a single bucket from a Datastore aggregation query.\n\nThe keys of `aggregate_properties` are the same for all results in an\naggregation query, unlike entity queries which can have different fields\npresent for each 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.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationResult), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AggregationResult](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.V1.AggregationResult), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[AggregationResult](/dotnet/docs/reference/Google.Cloud.Datastore.V1/latest/Google.Cloud.Datastore.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.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### AggregationResult()\n\n public AggregationResult()\n\n### AggregationResult(AggregationResult)\n\n public AggregationResult(AggregationResult other)\n\nProperties\n----------\n\n### AggregateProperties\n\n public MapField\u003cstring, Value\u003e AggregateProperties { get; }\n\nThe result of the aggregation functions, ex: `COUNT(*) AS total_entities`.\n\nThe key is the\n\\[alias\\]\\[google.datastore.v1.AggregationQuery.Aggregation.alias\\] assigned to\nthe aggregation function on input and the size of this map equals the\nnumber of aggregation functions in the query."]]