API documentation for datastore.aggregation
module.
Classes
AggregationQuery
AggregationQuery(client, query)
An Aggregation query against the Cloud Datastore.
This class serves as an abstraction for creating aggregations over query in the Cloud Datastore.
Parameters | |
---|---|
Name | Description |
client |
Client
The client used to connect to Datastore. |
query |
Query
The query used for aggregations. |
AggregationResult
AggregationResult(alias, value)
A class representing result from Aggregation Query
Parameters | |
---|---|
Name | Description |
alias |
str
The alias for the aggregation. |
value |
int
The resulting value from the aggregation. |
AggregationResultIterator
AggregationResultIterator(
aggregation_query,
client,
limit=None,
eventual=False,
retry=None,
timeout=None,
read_time=None,
)
Represent the state of a given execution of a Query.
Parameters | |
---|---|
Name | Description |
aggregation_query |
AggregationQuery
AggregationQuery object holding permanent configuration (i.e. things that don't change on with each page in a results set). |
client |
Client
The client used to make a request. |
eventual |
bool
(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 |
A retry object used to retry requests. If |
timeout |
float
Time, in seconds, to wait for the request to complete. Note that if |
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. |
BaseAggregation
BaseAggregation()
Base class representing an Aggregation operation in Datastore
CountAggregation
CountAggregation(alias=None)
Representation of a "Count" aggregation query.
Parameters | |
---|---|
Name | Description |
alias |
str
The alias for the aggregation. |
value |
int
The resulting value from the aggregation. |