StructuredQuery(mapping=None, *, ignore_unknown_fields=False, **kwargs)
A Firestore query.
Attributes | |
---|---|
Name | Description |
select |
google.cloud.firestore_v1.types.StructuredQuery.Projection
The projection to return. |
from_ |
Sequence[google.cloud.firestore_v1.types.StructuredQuery.CollectionSelector]
The collections to query. |
where |
google.cloud.firestore_v1.types.StructuredQuery.Filter
The filter to apply. |
order_by |
Sequence[google.cloud.firestore_v1.types.StructuredQuery.Order]
The order to apply to the query results. Firestore guarantees a stable ordering through the following rules: - Any field required to appear in order_by , that is not
already specified in order_by , is appended to the
order in field name order by default.
- If an order on __name__ is not specified, it is
appended by default.
Fields are appended with the same sort direction as the last
order specified, or 'ASCENDING' if no order was specified.
For example:
- SELECT * FROM Foo ORDER BY A becomes
SELECT * FROM Foo ORDER BY A, __name__
- SELECT * FROM Foo ORDER BY A DESC becomes
SELECT * FROM Foo ORDER BY A DESC, __name__ DESC
- SELECT * FROM Foo WHERE A > 1 becomes
SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__
|
start_at |
google.cloud.firestore_v1.types.Cursor
A starting point for the query results. |
end_at |
google.cloud.firestore_v1.types.Cursor
A end point for the query results. |
offset |
int
The number of results to skip. Applies before limit, but after all other constraints. Must be >= 0 if specified. |
limit |
google.protobuf.wrappers_pb2.Int32Value
The maximum number of results to return. Applies after all other constraints. Must be >= 0 if specified. |
Classes
CollectionSelector
CollectionSelector(mapping=None, *, ignore_unknown_fields=False, **kwargs)
A selection of a collection, such as messages as m1
.
CompositeFilter
CompositeFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)
A filter that merges multiple other filters using the given operator.
Direction
Direction(value)
A sort direction.
FieldFilter
FieldFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)
A filter on a specific field.
FieldReference
FieldReference(mapping=None, *, ignore_unknown_fields=False, **kwargs)
A reference to a field, such as max(messages.time) as max_time
.
Filter
Filter(mapping=None, *, ignore_unknown_fields=False, **kwargs)
A filter.
This message has oneof
_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Order
Order(mapping=None, *, ignore_unknown_fields=False, **kwargs)
An order on a field.
Projection
Projection(mapping=None, *, ignore_unknown_fields=False, **kwargs)
The projection of document's fields to return.
UnaryFilter
UnaryFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)
A filter with a single operand.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields