A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cloud.google.com/python/docs/reference/datastore/2.14.0/aggregations below:

Python client library | Google Cloud

Skip to main content

Stay organized with collections Save and categorize content based on your preferences.

Aggregations class google.cloud.datastore.aggregation.AggregationQuery(client, query)

Bases: object

An Aggregation query against the Cloud Datastore.

This class serves as an abstraction for creating aggregations over query in the Cloud Datastore.

add_aggregation(aggregation)

Adds an aggregation operation to the nested query

add_aggregations(aggregations)

Adds a list of aggregations to the nested query :type aggregations: list :param aggregations: a list of aggregation operations

count(alias=None)

Adds a count over the nested query

fetch(client=None, limit=None, eventual=False, retry=None, timeout=None, read_time=None)

Execute the Aggregation Query; return an iterator for the aggregation results.

For example:

>>> andy = datastore.Entity(client.key('Person', 1234))
>>> andy['name'] = 'Andy'
>>> sally = datastore.Entity(client.key('Person', 2345))
>>> sally['name'] = 'Sally'
>>> bobby = datastore.Entity(client.key('Person', 3456))
>>> bobby['name'] = 'Bobby'
>>> client.put_multi([andy, sally, bobby])
>>> query = client.query(kind='Andy')
>>> aggregation_query = client.aggregation_query(query)
>>> result = aggregation_query.count(alias="total").fetch(limit=5)
>>> result
<google.cloud.datastore.aggregation.AggregationResultIterator object at ...>
property namespace()

The nested query’s namespace

property project()

Get the project for this AggregationQuery.

class google.cloud.datastore.aggregation.AggregationResult(alias, value)

Bases: object

A class representing result from Aggregation Query

class google.cloud.datastore.aggregation.AggregationResultIterator(aggregation_query, client, limit=None, eventual=False, retry=None, timeout=None, read_time=None)

Bases: google.api_core.page_iterator.Iterator

Represent the state of a given execution of a Query.

class google.cloud.datastore.aggregation.BaseAggregation()

Bases: abc.ABC

Base class representing an Aggregation operation in Datastore

class google.cloud.datastore.aggregation.CountAggregation(alias=None)

Bases: google.cloud.datastore.aggregation.BaseAggregation

Representation of a “Count” aggregation query.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["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."],[],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4