- JSON representation
- Projection
- KindExpression
- Filter
- CompositeFilter
- Operator
- PropertyFilter
- Operator
- PropertyOrder
- Direction
A query for entities.
JSON representation |
---|
{ "projection" : [ { object ( |
projection[]
object (
Projection
)
The projection to return. Defaults to returning all properties.
kind[]
object (
KindExpression
)
The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.
filter
object (
Filter
)
The filter to apply.
order[]
object (
PropertyOrder
)
The order to apply to the query results (if empty, order is unspecified).
distinct
On[]
object (
PropertyReference
)
The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).
Requires:
- If
order
is specified, the set of distinct on properties must appear before the non-distinct on properties inorder
.
start
Cursor
string ( bytes
format)
A starting point for the query results. Query cursors are returned in query result batches and can only be used to continue the same query .
A base64-encoded string.
end
Cursor
string ( bytes
format)
An ending point for the query results. Query cursors are returned in query result batches and can only be used to limit the same query .
A base64-encoded string.
offset
integer
The number of results to skip. Applies before limit, but after all other constraints. Optional. Must be >= 0 if specified.
limit
integer
The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.
Projection
A representation of a property in a projection.
JSON representation |
---|
{
"property"
:
{
object (
|
Fields | |
---|---|
property
|
The property to project. |
KindExpression
A representation of a kind.
JSON representation |
---|
{ "name" : string } |
Fields | |
---|---|
name
|
The name of the kind. |
Filter
A holder for any type of filter.
JSON representation |
---|
{ // Union field |
filter_type
. The type of filter. filter_type
can be only one of the following:composite
Filter
object (
CompositeFilter
)
A composite filter.
property
Filter
object (
PropertyFilter
)
A filter on a property.
CompositeFilter
A filter that merges multiple other filters using the given operator.
JSON representation |
---|
{ "op" : enum ( |
Operator
A composite filter operator.
Enums | |
---|---|
OPERATOR_UNSPECIFIED
|
Unspecified. This value must not be used. |
AND
|
The results are required to satisfy each of the combined filters. |
OR
|
Documents are required to satisfy at least one of the combined filters. |
PropertyFilter
A filter on a specific property.
JSON representation |
---|
{ "property" : { object ( |
Fields | |
---|---|
property
|
The property to filter by. |
op
|
The operator to filter by. |
value
|
The value to compare the property to. |
Operator
A property filter operator.
OPERATOR_UNSPECIFIED
LESS_THAN
The given property
is less than the given value
.
Requires:
- That
property
comes first inorder_by
.
LESS_THAN_OR_EQUAL
The given property
is less than or equal to the given value
.
Requires:
- That
property
comes first inorder_by
.
GREATER_THAN
The given property
is greater than the given value
.
Requires:
- That
property
comes first inorder_by
.
GREATER_THAN_OR_EQUAL
The given property
is greater than or equal to the given value
.
Requires:
- That
property
comes first inorder_by
.
EQUAL
property
is equal to the given value
.IN
The given property
is equal to at least one value in the given array.
Requires:
- That
value
is a non-emptyArrayValue
, subject to disjunction limits. - No
NOT_IN
is in the same query.
NOT_EQUAL
The given property
is not equal to the given value
.
Requires:
- No other
NOT_EQUAL
orNOT_IN
is in the same query. - That
property
comes first in theorder_by
.
HAS_ANCESTOR
Limit the result set to the given entity and its descendants.
Requires:
- That
value
is an entity key. - All evaluated disjunctions must have the same
HAS_ANCESTOR
filter.
NOT_IN
The value of the property
is not in the given array.
Requires:
- That
value
is a non-emptyArrayValue
with at most 10 values. - No other
OR
,IN
,NOT_IN
,NOT_EQUAL
is in the same query. - That
field
comes first in theorder_by
.
PropertyOrder
The desired order for a specific property.
JSON representation |
---|
{ "property" : { object ( |
Fields | |
---|---|
property
|
The property to order by. |
direction
|
The direction to order by. Defaults to |
Direction
The sort direction.
Enums | |
---|---|
DIRECTION_UNSPECIFIED
|
Unspecified. This value must not be used. |
ASCENDING
|
Ascending. |
DESCENDING
|
Descending. |