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.20.2/aggregations below:

Python client library | Google Cloud

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

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

avg(property_ref, alias=None)

Adds a avg over the nested query

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.

sum(property_ref, alias=None)

Adds a sum over the nested query

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.

property explain_metrics(: google.cloud.datastore.query_profile.ExplainMetric )

Get the metrics associated with the query execution. Metrics are only available when explain_options is set on the query. If ExplainOptions.analyze is False, only plan_summary is available. If it is True, execution_stats is also available.

class google.cloud.datastore.aggregation.AvgAggregation(property_ref, alias=None)

Bases: google.cloud.datastore.aggregation.BaseAggregation

Representation of a “Avg” aggregation query.

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

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.

class google.cloud.datastore.aggregation.SumAggregation(property_ref, alias=None)

Bases: google.cloud.datastore.aggregation.BaseAggregation

Representation of a “Sum” aggregation query.


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