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/latest/queries below:

Python client library | Google Cloud

Queries

Create / interact with Google Cloud Datastore queries.

class google.cloud.datastore.query.And(filters)

Bases: google.cloud.datastore.query.BaseCompositeFilter

Class representation of an AND Filter.

class google.cloud.datastore.query.BaseCompositeFilter(operation=Operator.OPERATOR_UNSPECIFIED, filters=None)

Bases: google.cloud.datastore.query.BaseFilter

Base class for a Composite Filter. (either OR or AND).

build_pb(container_pb=None)

Build the protobuf representation based on values in the Composite Filter.

class google.cloud.datastore.query.BaseFilter()

Bases: abc.ABC

Base class for Filters

abstract build_pb(container_pb=None)

Build the protobuf representation based on values in the Filter.

class google.cloud.datastore.query.Iterator(query, client, limit=None, offset=None, start_cursor=None, end_cursor=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.query.Or(filters)

Bases: google.cloud.datastore.query.BaseCompositeFilter

Class representation of an OR Filter.

class google.cloud.datastore.query.PropertyFilter(property_name, operator, value)

Bases: google.cloud.datastore.query.BaseFilter

Class representation of a Property Filter

build_pb(container_pb=None)

Build the protobuf representation based on values in the Property Filter.

class google.cloud.datastore.query.Query(client, kind=None, project=None, namespace=None, ancestor=None, filters=(), projection=(), order=(), distinct_on=(), explain_options=None)

Bases: object

A Query against the Cloud Datastore.

This class serves as an abstraction for creating a query over data stored in the Cloud Datastore.

OPERATORS( = {'!=': Operator.NOT_EQUAL, '<': Operator.LESS_THAN, '<=': Operator.LESS_THAN_OR_EQUAL, '=': Operator.EQUAL, '>': Operator.GREATER_THAN, '>=': Operator.GREATER_THAN_OR_EQUAL, 'IN': Operator.IN, 'NOT_IN': Operator.NOT_IN )

Mapping of operator strings and their protobuf equivalents.

add_filter(property_name=None, operator=None, value=None, *, filter=None)

Filter the query based on a property name, operator and a value.

Expressions take the form of:

.add_filter(
  filter=PropertyFilter('<property>', '<operator>', <value>)
)

where property is a property stored on the entity in the datastore and operator is one of OPERATORS (ie, =, <, <=, >, >=, !=, IN, NOT_IN):

Both AND and OR operations are supported by passing in a CompositeFilter object to the filter parameter:

.add_filter(
    filter=And(
        [
            PropertyFilter('<property>', '<operator>', <value>),
            PropertyFilter('<property>', '<operator>', <value>)

        ]
    )
)

.add_filter(
    filter=Or(
        [
            PropertyFilter('<property>', '<operator>', <value>),
            PropertyFilter('<property>', '<operator>', <value>)
        ]
    )
)
>>> query = client.query(kind='Person')
>>> query = query.add_filter(filter=PropertyFilter('name', '=', 'James'))
>>> query = query.add_filter(filter=PropertyFilter('age', '>', 50))
property ancestor()

The ancestor key for the query.

property distinct_on()

Names of fields used to group query results.

fetch(limit=None, offset=0, start_cursor=None, end_cursor=None, client=None, eventual=False, retry=None, timeout=None, read_time=None)

Execute the Query; return an iterator for the matching entities.

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='Person')
>>> result = list(query.add_filter(filter=PropertyFilter('name', '=', 'Sally')).fetch())
>>> result
[<Entity('Person', 2345) {'name': 'Sally'}>]
property filters()

Filters set on the query.

key_filter(key, operator='=')

Filter on a key.

keys_only()

Set the projection to include only keys.

property kind()

Get the Kind of the Query.

property namespace()

This query’s namespace

property order()

Names of fields used to sort query results.

property project()

Get the project for this Query.

property projection()

Fields names returned by the 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