(Optional) Options to enable query profiling for this query. When set, explain_metrics will be available on the iterator returned by query.fetch(). If not passed, will use value from given query.
(Optional) Defaults to strongly consistent (False). Setting True will use eventual consistency, but cannot be used inside a transaction or with read_time, otherwise will raise ValueError.
retry
google.api_core.retry.Retry
A retry object used to retry requests. If None is specified, requests will be retried using a default configuration.
timeout
float
Time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt.
read_time
datetime
(Optional) Runs the query with read time consistency. Cannot be used with eventual consistency or inside a transaction, otherwise will raise ValueError. This feature is in private preview.
[[["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-28 UTC."],[],[],null,["# Module aggregation (2.21.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.21.0 (latest)](/python/docs/reference/datastore/latest/google.cloud.datastore.aggregation)\n- [2.20.2](/python/docs/reference/datastore/2.20.2/google.cloud.datastore.aggregation)\n- [2.19.0](/python/docs/reference/datastore/2.19.0/google.cloud.datastore.aggregation)\n- [2.18.0](/python/docs/reference/datastore/2.18.0/google.cloud.datastore.aggregation)\n- [2.17.0](/python/docs/reference/datastore/2.17.0/google.cloud.datastore.aggregation)\n- [2.16.1](/python/docs/reference/datastore/2.16.1/google.cloud.datastore.aggregation)\n- [2.15.2](/python/docs/reference/datastore/2.15.2/google.cloud.datastore.aggregation)\n- [2.14.0](/python/docs/reference/datastore/2.14.0/google.cloud.datastore.aggregation)\n- [2.13.2](/python/docs/reference/datastore/2.13.2/google.cloud.datastore.aggregation)\n- [2.12.0](/python/docs/reference/datastore/2.12.0/google.cloud.datastore.aggregation)\n- [2.11.1](/python/docs/reference/datastore/2.11.1/google.cloud.datastore.aggregation)\n- [2.10.0](/python/docs/reference/datastore/2.10.0/google.cloud.datastore.aggregation)\n- [2.9.0](/python/docs/reference/datastore/2.9.0/google.cloud.datastore.aggregation)\n- [2.8.3](/python/docs/reference/datastore/2.8.3/google.cloud.datastore.aggregation)\n- [2.7.2](/python/docs/reference/datastore/2.7.2/google.cloud.datastore.aggregation)\n- [2.6.2](/python/docs/reference/datastore/2.6.2/google.cloud.datastore.aggregation)\n- [2.5.1](/python/docs/reference/datastore/2.5.1/google.cloud.datastore.aggregation)\n- [2.4.0](/python/docs/reference/datastore/2.4.0/google.cloud.datastore.aggregation)\n- [2.3.0](/python/docs/reference/datastore/2.3.0/google.cloud.datastore.aggregation)\n- [2.2.0](/python/docs/reference/datastore/2.2.0/google.cloud.datastore.aggregation)\n- [2.1.6](/python/docs/reference/datastore/2.1.6/google.cloud.datastore.aggregation)\n- [2.0.1](/python/docs/reference/datastore/2.0.1/google.cloud.datastore.aggregation)\n- [1.15.5](/python/docs/reference/datastore/1.15.5/google.cloud.datastore.aggregation)\n- [1.14.0](/python/docs/reference/datastore/1.14.0/google.cloud.datastore.aggregation)\n- [1.13.2](/python/docs/reference/datastore/1.13.2/google.cloud.datastore.aggregation)\n- [1.12.0](/python/docs/reference/datastore/1.12.0/google.cloud.datastore.aggregation)\n- [1.11.0](/python/docs/reference/datastore/1.11.0/google.cloud.datastore.aggregation)\n- [1.10.0](/python/docs/reference/datastore/1.10.0/google.cloud.datastore.aggregation)\n- [1.9.0](/python/docs/reference/datastore/1.9.0/google.cloud.datastore.aggregation) \nAPI documentation for `datastore.aggregation` module.\n\nClasses\n-------\n\n### [AggregationQuery](/python/docs/reference/datastore/latest/google.cloud.datastore.aggregation.AggregationQuery)\n\n AggregationQuery(client, query, explain_options=None)\n\nAn Aggregation query against the Cloud Datastore.\n\nThis class serves as an abstraction for creating aggregations over query\nin the Cloud Datastore.\n\n### [AggregationResult](/python/docs/reference/datastore/latest/google.cloud.datastore.aggregation.AggregationResult)\n\n AggregationResult(alias, value)\n\nA class representing result from Aggregation Query\n\n### [AggregationResultIterator](/python/docs/reference/datastore/latest/google.cloud.datastore.aggregation.AggregationResultIterator)\n\n AggregationResultIterator(\n aggregation_query,\n client,\n limit=None,\n eventual=False,\n retry=None,\n timeout=None,\n read_time=None,\n )\n\nRepresent the state of a given execution of a Query.\n\n### [AvgAggregation](/python/docs/reference/datastore/latest/google.cloud.datastore.aggregation.AvgAggregation)\n\n AvgAggregation(property_ref, alias=None)\n\nRepresentation of a \"Avg\" aggregation query.\n\n### [BaseAggregation](/python/docs/reference/datastore/latest/google.cloud.datastore.aggregation.BaseAggregation)\n\n BaseAggregation(alias=None)\n\nBase class representing an Aggregation operation in Datastore\n\n### [CountAggregation](/python/docs/reference/datastore/latest/google.cloud.datastore.aggregation.CountAggregation)\n\n CountAggregation(alias=None)\n\nRepresentation of a \"Count\" aggregation query.\n\n### [SumAggregation](/python/docs/reference/datastore/latest/google.cloud.datastore.aggregation.SumAggregation)\n\n SumAggregation(property_ref, alias=None)\n\nRepresentation of a \"Sum\" aggregation query."]]