Create / interact with Google Cloud Datastore queries.
Classes
Iterator
Iterator(
query,
client,
limit=None,
offset=None,
start_cursor=None,
end_cursor=None,
eventual=False,
retry=None,
timeout=None,
)
Represent the state of a given execution of a Query.
Name | Description |
query |
Query
Query 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. |
limit |
int
(Optional) Limit the number of results returned. |
offset |
int
(Optional) Offset used to begin a query. |
start_cursor |
bytes
(Optional) Cursor to begin paging through query results. |
end_cursor |
bytes
(Optional) Cursor to end paging through query results. |
eventual |
bool
(Optional) Defaults to strongly consistent (False). Setting True will use eventual consistency, but cannot be used inside a transaction or will raise ValueError. |
retry |
`google.api_core.retry.Retry`
A retry object used to retry requests. If |
timeout |
float
Time, in seconds, to wait for the request to complete. Note that if |
Query
Query(
client,
kind=None,
project=None,
namespace=None,
ancestor=None,
filters=(),
projection=(),
order=(),
distinct_on=(),
)
A Query against the Cloud Datastore.
This class serves as an abstraction for creating a query over data stored in the Cloud Datastore.
Name | Description |
client |
Client
The client used to connect to Datastore. |
kind |
str
The kind to query. |
project |
str
(Optional) The project associated with the query. If not passed, uses the client's value. |
namespace |
str
(Optional) The namespace to which to restrict results. If not passed, uses the client's value. |
ancestor |
Key
(Optional) key of the ancestor to which this query's results are restricted. |
filters |
tuple[str, str, str]
Property filters applied by this query. The sequence is |
projection |
sequence of string
fields returned as part of query results. |
order |
sequence of string
field names used to order query results. Prepend |
distinct_on |
sequence of string
field names used to group query results. |
Type | Description |
ValueErro | if ``project`` is not passed and no implicit default is set. |