Requires authorization
Query for entities. Try it now .
Request
HTTP request
POST https://www.googleapis.com/datastore/v1beta2/datasets/datasetId/runQuery
Parameters
Parameter name | Value | Description |
---|---|---|
Path parameters | ||
datasetId
|
string
|
Identifies the dataset. |
Authorization
This request requires authorization with at least one of the following scopes ( read more about authentication and authorization ).
Scope |
---|
https://www.googleapis.com/auth/datastore
|
https://www.googleapis.com/auth/userinfo.email
|
Request body
In the request body, supply data with the following structure:
{ "readOptions": { "readConsistency": string, "transaction": bytes }, "partitionId": { "datasetId": string, "namespace": string }, "query": { "projection": [ { "property": { "name": string }, "aggregationFunction": string } ], "kinds": [ { "name": string } ], "filter": { "compositeFilter": { "operator": string, "filters": [ (Filter) ] }, "propertyFilter": { "property": { "name": string }, "operator": string, "value": { "booleanValue": boolean, "integerValue": long, "doubleValue": double, "dateTimeValue": datetime, "keyValue": { "partitionId": { "datasetId": string, "namespace": string }, "path": [ { "kind": string, "id": long, "name": string } ] }, "blobKeyValue": string, "stringValue": string, "blobValue": bytes, "entityValue": { "key": { "partitionId": { "datasetId": string, "namespace": string }, "path": [ { "kind": string, "id": long, "name": string } ] }, "properties": { (key): { "booleanValue": boolean, "integerValue": long, "doubleValue": double, "dateTimeValue": datetime, "keyValue": { "partitionId": { "datasetId": string, "namespace": string }, "path": [ { "kind": string, "id": long, "name": string } ] }, "blobKeyValue": string, "stringValue": string, "blobValue": bytes, "entityValue": (Entity), "listValue": [ (Value) ], "meaning": integer, "indexed": boolean } } }, "listValue": [ (Value) ], "meaning": integer, "indexed": boolean } } }, "order": [ { "property": { "name": string }, "direction": string } ], "groupBy": [ { "name": string } ], "startCursor": bytes, "endCursor": bytes, "offset": integer, "limit": integer }, "gqlQuery": { "queryString": string, "allowLiteral": boolean, "nameArgs": [ { "name": string, "value": { "booleanValue": boolean, "integerValue": long, "doubleValue": double, "dateTimeValue": datetime, "keyValue": { "partitionId": { "datasetId": string, "namespace": string }, "path": [ { "kind": string, "id": long, "name": string } ] }, "blobKeyValue": string, "stringValue": string, "blobValue": bytes, "entityValue": { "key": { "partitionId": { "datasetId": string, "namespace": string }, "path": [ { "kind": string, "id": long, "name": string } ] }, "properties": { (key): { "booleanValue": boolean, "integerValue": long, "doubleValue": double, "dateTimeValue": datetime, "keyValue": { "partitionId": { "datasetId": string, "namespace": string }, "path": [ { "kind": string, "id": long, "name": string } ] }, "blobKeyValue": string, "stringValue": string, "blobValue": bytes, "entityValue": (Entity), "listValue": [ (Value) ], "meaning": integer, "indexed": boolean } } }, "listValue": [ (Value) ], "meaning": integer, "indexed": boolean }, "cursor": bytes } ], "numberArgs": [ { "name": string, "value": { "booleanValue": boolean, "integerValue": long, "doubleValue": double, "dateTimeValue": datetime, "keyValue": { "partitionId": { "datasetId": string, "namespace": string }, "path": [ { "kind": string, "id": long, "name": string } ] }, "blobKeyValue": string, "stringValue": string, "blobValue": bytes, "entityValue": { "key": { "partitionId": { "datasetId": string, "namespace": string }, "path": [ { "kind": string, "id": long, "name": string } ] }, "properties": { (key): { "booleanValue": boolean, "integerValue": long, "doubleValue": double, "dateTimeValue": datetime, "keyValue": { "partitionId": { "datasetId": string, "namespace": string }, "path": [ { "kind": string, "id": long, "name": string } ] }, "blobKeyValue": string, "stringValue": string, "blobValue": bytes, "entityValue": (Entity), "listValue": [ (Value) ], "meaning": integer, "indexed": boolean } } }, "listValue": [ (Value) ], "meaning": integer, "indexed": boolean }, "cursor": bytes } ] } }
Property name | Value | Description | Notes |
---|---|---|---|
readOptions
|
nested object
|
The options for this query. | |
readOptions.
readConsistency
|
string
|
The read consistency to use. One of
default
,
strong
, or
eventual
. Cannot be set when transaction is set. Lookup and ancestor queries default to
strong
, global queries default to
eventual
and cannot be set to
strong
. Optional. Default is
default
.
Acceptable values are:
|
|
readOptions.
transaction
|
bytes
|
The transaction to use. Optional. | |
partitionId
|
nested object
|
Entities are partitioned into subsets, identified by a dataset (usually implicitly specified by the project) and namespace ID. Queries are scoped to a single partition. This partition ID is normalized with the standard default context partition ID, but all other partition IDs in RunQueryRequest are normalized with this partition ID as the context partition ID. | |
partitionId.
datasetId
|
string
|
The dataset ID. | |
partitionId.
namespace
|
string
|
The namespace. | |
query
|
nested object
|
The query to run. Either this field or field gql_query must be set, but not both. | |
query.
projection[]
|
list
|
The projection to return. If not set the entire entity is returned. | |
query.projection[].
property
|
nested object
|
The property to project. | |
query.projection[].property.
name
|
string
|
The name of the property. | |
query.projection[].
aggregationFunction
|
string
|
The aggregation function to apply to the property. Optional. Can only be used when grouping by at least one property. Must then be set on all properties in the projection that are not being grouped by. Aggregation functions:
first
selects the first result as determined by the query's order.
Acceptable values are:
|
|
query.
kinds[]
|
list
|
The kinds to query (if empty, returns entities from all kinds). | |
query.kinds[].
name
|
string
|
The name of the kind. | |
query.
filter
|
nested object
|
The filter to apply (optional). | |
query.filter.
compositeFilter
|
nested object
|
A composite filter. | |
query.filter.compositeFilter.
operator
|
string
|
The operator for combining multiple filters. Only "and" is currently supported.
Acceptable values are:
|
|
query.filter.compositeFilter.
filters[]
|
list
|
The list of filters to combine. Must contain at least one filter. | |
query.filter.
propertyFilter
|
nested object
|
A filter on a property. | |
query.filter.propertyFilter.
property
|
nested object
|
The property to filter by. | |
query.filter.propertyFilter.property.
name
|
string
|
The name of the property. | |
query.filter.propertyFilter.
operator
|
string
|
The operator to filter by. One of
lessThan
,
lessThanOrEqual
,
greaterThan
,
greaterThanOrEqual
,
equal
, or
hasAncestor
.
Acceptable values are:
|
|
query.filter.propertyFilter.
value
|
nested object
|
The value to compare the property to. | |
query.filter.propertyFilter.value.
booleanValue
|
boolean
|
A boolean value. | |
query.filter.propertyFilter.value.
integerValue
|
long
|
An integer value. | |
query.filter.propertyFilter.value.
doubleValue
|
double
|
A double value. | |
query.filter.propertyFilter.value.
dateTimeValue
|
datetime
|
A timestamp value. | |
query.filter.propertyFilter.value.
keyValue
|
nested object
|
A key value. | |
query.filter.propertyFilter.value.keyValue.
partitionId
|
nested object
|
Entities are partitioned into subsets, currently identified by a dataset (usually implicitly specified by the project) and namespace ID. Queries are scoped to a single partition. | |
query.filter.propertyFilter.value.keyValue.partitionId.
datasetId
|
string
|
The dataset ID. | |
query.filter.propertyFilter.value.keyValue.partitionId.
namespace
|
string
|
The namespace. | |
query.filter.propertyFilter.value.keyValue.
path[]
|
list
|
The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity , the second element identifies a child of the root entity, the third element a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors . An entity path is always fully complete: ALL of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. A path can never be empty. | |
query.filter.propertyFilter.value.keyValue.path[].
kind
|
string
|
The kind of the entity. A kind matching regex "__.*__" is reserved/read-only. A kind must not contain more than 500 characters. Cannot be "". | |
query.filter.propertyFilter.value.keyValue.path[].
id
|
long
|
The ID of the entity. Never equal to zero. Values less than zero are discouraged and will not be supported in the future. | |
query.filter.propertyFilter.value.keyValue.path[].
name
|
string
|
The name of the entity. A name matching regex "__.*__" is reserved/read-only. A name must not be more than 500 characters. Cannot be "". | |
query.filter.propertyFilter.value.
blobKeyValue
|
string
|
A blob key value. | |
query.filter.propertyFilter.value.
stringValue
|
string
|
A UTF-8 encoded string value. | |
query.filter.propertyFilter.value.
blobValue
|
bytes
|
A blob value. | |
query.filter.propertyFilter.value.
entityValue
|
nested object
|
An entity value. May have no key. May have a key with an incomplete key path. May have a reserved/read-only key. | |
query.filter.propertyFilter.value.entityValue.
key
|
nested object
|
The entity's key.
An entity must have a key, unless otherwise documented (for example, an entity in
Value.entityValue
may have no key). An entity's kind is its key's path's last element's kind, or null if it has no key.
|
|
query.filter.propertyFilter.value.entityValue.key.
partitionId
|
nested object
|
Entities are partitioned into subsets, currently identified by a dataset (usually implicitly specified by the project) and namespace ID. Queries are scoped to a single partition. | |
query.filter.propertyFilter.value.entityValue.key.partitionId.
datasetId
|
string
|
The dataset ID. | |
query.filter.propertyFilter.value.entityValue.key.partitionId.
namespace
|
string
|
The namespace. | |
query.filter.propertyFilter.value.entityValue.key.
path[]
|
list
|
The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity , the second element identifies a child of the root entity, the third element a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors . An entity path is always fully complete: ALL of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. A path can never be empty. | |
query.filter.propertyFilter.value.entityValue.key.path[].
kind
|
string
|
The kind of the entity. A kind matching regex "__.*__" is reserved/read-only. A kind must not contain more than 500 characters. Cannot be "". | |
query.filter.propertyFilter.value.entityValue.key.path[].
id
|
long
|
The ID of the entity. Never equal to zero. Values less than zero are discouraged and will not be supported in the future. | |
query.filter.propertyFilter.value.entityValue.key.path[].
name
|
string
|
The name of the entity. A name matching regex "__.*__" is reserved/read-only. A name must not be more than 500 characters. Cannot be "". | |
query.filter.propertyFilter.value.entityValue.
properties
|
object
|
The entity's properties. | |
query.filter.propertyFilter.value.entityValue.properties.
(key)
|
nested object
|
The name of the property. A property name matching regex "__.*__" is reserved. A reserved property name is forbidden in certain documented contexts. The name must not contain more than 500 characters. Cannot be "". | |
query.filter.propertyFilter.value.entityValue.properties.(key).
booleanValue
|
boolean
|
A boolean value. | |
query.filter.propertyFilter.value.entityValue.properties.(key).
integerValue
|
long
|
An integer value. | |
query.filter.propertyFilter.value.entityValue.properties.(key).
doubleValue
|
double
|
A double value. | |
query.filter.propertyFilter.value.entityValue.properties.(key).
dateTimeValue
|
datetime
|
A timestamp value. | |
query.filter.propertyFilter.value.entityValue.properties.(key).
keyValue
|
nested object
|
A key value. | |
query.filter.propertyFilter.value.entityValue.properties.(key).keyValue.
partitionId
|
nested object
|
Entities are partitioned into subsets, currently identified by a dataset (usually implicitly specified by the project) and namespace ID. Queries are scoped to a single partition. | |
query.filter.propertyFilter.value.entityValue.properties.(key).keyValue.partitionId.
datasetId
|
string
|
The dataset ID. | |
query.filter.propertyFilter.value.entityValue.properties.(key).keyValue.partitionId.
namespace
|
string
|
The namespace. | |
query.filter.propertyFilter.value.entityValue.properties.(key).keyValue.
path[]
|
list
|
The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity , the second element identifies a child of the root entity, the third element a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors . An entity path is always fully complete: ALL of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. A path can never be empty. | |
query.filter.propertyFilter.value.entityValue.properties.(key).keyValue.path[].
kind
|
string
|
The kind of the entity. A kind matching regex "__.*__" is reserved/read-only. A kind must not contain more than 500 characters. Cannot be "". | |
query.filter.propertyFilter.value.entityValue.properties.(key).keyValue.path[].
id
|
long
|
The ID of the entity. Never equal to zero. Values less than zero are discouraged and will not be supported in the future. | |
query.filter.propertyFilter.value.entityValue.properties.(key).keyValue.path[].
name
|
string
|
The name of the entity. A name matching regex "__.*__" is reserved/read-only. A name must not be more than 500 characters. Cannot be "". | |
query.filter.propertyFilter.value.entityValue.properties.(key).
blobKeyValue
|
string
|
A blob key value. | |
query.filter.propertyFilter.value.entityValue.properties.(key).
stringValue
|
string
|
A UTF-8 encoded string value. | |
query.filter.propertyFilter.value.entityValue.properties.(key).
blobValue
|
bytes
|
A blob value. | |
query.filter.propertyFilter.value.entityValue.properties.(key).
entityValue
|
nested object
|
An entity value. May have no key. May have a key with an incomplete key path. May have a reserved/read-only key. | |
query.filter.propertyFilter.value.entityValue.properties.(key).
listValue[]
|
list
|
A list value. Cannot contain another list value. Cannot also have a meaning and indexing set. | |
query.filter.propertyFilter.value.entityValue.properties.(key).
meaning
|
integer
|
The
meaning
field is reserved and should not be used.
|
|
query.filter.propertyFilter.value.entityValue.properties.(key).
indexed
|
boolean
|
If the value should be indexed.
The
indexed
property may be set for a
null
value. When
indexed
is
true
,
stringValue
is limited to 500 characters and the blob value is limited to 500 bytes. Input values by default have
indexed
set to
true
; however, you can explicitly set
indexed
to
true
if you want. (An output value never has
indexed
explicitly set to
true
.) If a value is itself an entity, it cannot have
indexed
set to
true
.
|
|
query.filter.propertyFilter.value.
listValue[]
|
list
|
A list value. Cannot contain another list value. Cannot also have a meaning and indexing set. | |
query.filter.propertyFilter.value.
meaning
|
integer
|
The
meaning
field is reserved and should not be used.
|
|
query.filter.propertyFilter.value.
indexed
|
boolean
|
If the value should be indexed.
The
indexed
property may be set for a
null
value. When
indexed
is
true
,
stringValue
is limited to 500 characters and the blob value is limited to 500 bytes. Input values by default have
indexed
set to
true
; however, you can explicitly set
indexed
to
true
if you want. (An output value never has
indexed
explicitly set to
true
.) If a value is itself an entity, it cannot have
indexed
set to
true
.
|
|
query.
order[]
|
list
|
The order to apply to the query results (if empty, order is unspecified). | |
query.order[].
property
|
nested object
|
The property to order by. | |
query.order[].property.
name
|
string
|
The name of the property. | |
query.order[].
direction
|
string
|
The direction to order by. One of
ascending
or
descending
. Optional, defaults to
ascending
.
Acceptable values are:
|
|
query.
groupBy[]
|
list
|
The properties to group by (if empty, no grouping is applied to the result set). | |
query.groupBy[].
name
|
string
|
The name of the property. | |
query.
startCursor
|
bytes
|
A starting point for the query results. Optional. Query cursors are returned in query result batches. | |
query.
endCursor
|
bytes
|
An ending point for the query results. Optional. Query cursors are returned in query result batches. | |
query.
offset
|
integer
|
The number of results to skip. Applies before limit, but after all other constraints (optional, defaults to 0). | |
query.
limit
|
integer
|
The maximum number of results to return. Applies after all other constraints. Optional. | |
gqlQuery
|
nested object
|
The GQL query to run. Either this field or field query must be set, but not both. | |
gqlQuery.
queryString
|
string
|
||
gqlQuery.
allowLiteral
|
boolean
|
When false, the query string must not contain a literal. | |
gqlQuery.
nameArgs[]
|
list
|
A named argument must set field GqlQueryArg.name. No two named arguments may have the same name. For each non-reserved named binding site in the query string, there must be a named argument with that name, but not necessarily the inverse. | |
gqlQuery.nameArgs[].
name
|
string
|
Must match regex "[A-Za-z_$][A-Za-z_$0-9]*". Must not match regex "__.*__". Must not be "". | |
gqlQuery.nameArgs[].
value
|
nested object
|
||
gqlQuery.nameArgs[].value.
booleanValue
|
boolean
|
A boolean value. | |
gqlQuery.nameArgs[].value.
integerValue
|
long
|
An integer value. | |
gqlQuery.nameArgs[].value.
doubleValue
|
double
|
A double value. | |
gqlQuery.nameArgs[].value.
dateTimeValue
|
datetime
|
A timestamp value. | |
gqlQuery.nameArgs[].value.
keyValue
|
nested object
|
A key value. | |
gqlQuery.nameArgs[].value.keyValue.
partitionId
|
nested object
|
Entities are partitioned into subsets, currently identified by a dataset (usually implicitly specified by the project) and namespace ID. Queries are scoped to a single partition. | |
gqlQuery.nameArgs[].value.keyValue.partitionId.
datasetId
|
string
|
The dataset ID. | |
gqlQuery.nameArgs[].value.keyValue.partitionId.
namespace
|
string
|
The namespace. | |
gqlQuery.nameArgs[].value.keyValue.
path[]
|
list
|
The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity , the second element identifies a child of the root entity, the third element a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors . An entity path is always fully complete: ALL of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. A path can never be empty. | |
gqlQuery.nameArgs[].value.keyValue.path[].
kind
|
string
|
The kind of the entity. A kind matching regex "__.*__" is reserved/read-only. A kind must not contain more than 500 characters. Cannot be "". | |
gqlQuery.nameArgs[].value.keyValue.path[].
id
|
long
|
The ID of the entity. Never equal to zero. Values less than zero are discouraged and will not be supported in the future. | |
gqlQuery.nameArgs[].value.keyValue.path[].
name
|
string
|
The name of the entity. A name matching regex "__.*__" is reserved/read-only. A name must not be more than 500 characters. Cannot be "". | |
gqlQuery.nameArgs[].value.
blobKeyValue
|
string
|
A blob key value. | |
gqlQuery.nameArgs[].value.
stringValue
|
string
|
A UTF-8 encoded string value. | |
gqlQuery.nameArgs[].value.
blobValue
|
bytes
|
A blob value. | |
gqlQuery.nameArgs[].value.
entityValue
|
nested object
|
An entity value. May have no key. May have a key with an incomplete key path. May have a reserved/read-only key. | |
gqlQuery.nameArgs[].value.entityValue.
key
|
nested object
|
The entity's key.
An entity must have a key, unless otherwise documented (for example, an entity in
Value.entityValue
may have no key). An entity's kind is its key's path's last element's kind, or null if it has no key.
|
|
gqlQuery.nameArgs[].value.entityValue.key.
partitionId
|
nested object
|
Entities are partitioned into subsets, currently identified by a dataset (usually implicitly specified by the project) and namespace ID. Queries are scoped to a single partition. | |
gqlQuery.nameArgs[].value.entityValue.key.partitionId.
datasetId
|
string
|
The dataset ID. | |
gqlQuery.nameArgs[].value.entityValue.key.partitionId.
namespace
|
string
|
The namespace. | |
gqlQuery.nameArgs[].value.entityValue.key.
path[]
|
list
|
The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity , the second element identifies a child of the root entity, the third element a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors . An entity path is always fully complete: ALL of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. A path can never be empty. | |
gqlQuery.nameArgs[].value.entityValue.key.path[].
kind
|
string
|
The kind of the entity. A kind matching regex "__.*__" is reserved/read-only. A kind must not contain more than 500 characters. Cannot be "". | |
gqlQuery.nameArgs[].value.entityValue.key.path[].
id
|
long
|
The ID of the entity. Never equal to zero. Values less than zero are discouraged and will not be supported in the future. | |
gqlQuery.nameArgs[].value.entityValue.key.path[].
name
|
string
|
The name of the entity. A name matching regex "__.*__" is reserved/read-only. A name must not be more than 500 characters. Cannot be "". | |
gqlQuery.nameArgs[].value.entityValue.
properties
|
object
|
The entity's properties. | |
gqlQuery.nameArgs[].value.entityValue.properties.
(key)
|
nested object
|
The name of the property. A property name matching regex "__.*__" is reserved. A reserved property name is forbidden in certain documented contexts. The name must not contain more than 500 characters. Cannot be "". | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).
booleanValue
|
boolean
|
A boolean value. | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).
integerValue
|
long
|
An integer value. | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).
doubleValue
|
double
|
A double value. | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).
dateTimeValue
|
datetime
|
A timestamp value. | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).
keyValue
|
nested object
|
A key value. | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).keyValue.
partitionId
|
nested object
|
Entities are partitioned into subsets, currently identified by a dataset (usually implicitly specified by the project) and namespace ID. Queries are scoped to a single partition. | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).keyValue.partitionId.
datasetId
|
string
|
The dataset ID. | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).keyValue.partitionId.
namespace
|
string
|
The namespace. | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).keyValue.
path[]
|
list
|
The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity , the second element identifies a child of the root entity, the third element a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors . An entity path is always fully complete: ALL of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. A path can never be empty. | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).keyValue.path[].
kind
|
string
|
The kind of the entity. A kind matching regex "__.*__" is reserved/read-only. A kind must not contain more than 500 characters. Cannot be "". | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).keyValue.path[].
id
|
long
|
The ID of the entity. Never equal to zero. Values less than zero are discouraged and will not be supported in the future. | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).keyValue.path[].
name
|
string
|
The name of the entity. A name matching regex "__.*__" is reserved/read-only. A name must not be more than 500 characters. Cannot be "". | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).
blobKeyValue
|
string
|
A blob key value. | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).
stringValue
|
string
|
A UTF-8 encoded string value. | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).
blobValue
|
bytes
|
A blob value. | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).
entityValue
|
nested object
|
An entity value. May have no key. May have a key with an incomplete key path. May have a reserved/read-only key. | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).
listValue[]
|
list
|
A list value. Cannot contain another list value. Cannot also have a meaning and indexing set. | |
gqlQuery.nameArgs[].value.entityValue.properties.(key).
meaning
|
integer
|
The
meaning
field is reserved and should not be used.
|
|
gqlQuery.nameArgs[].value.entityValue.properties.(key).
indexed
|
boolean
|
If the value should be indexed.
The
indexed
property may be set for a
null
value. When
indexed
is
true
,
stringValue
is limited to 500 characters and the blob value is limited to 500 bytes. Input values by default have
indexed
set to
true
; however, you can explicitly set
indexed
to
true
if you want. (An output value never has
indexed
explicitly set to
true
.) If a value is itself an entity, it cannot have
indexed
set to
true
.
|
|
gqlQuery.nameArgs[].value.
listValue[]
|
list
|
A list value. Cannot contain another list value. Cannot also have a meaning and indexing set. | |
gqlQuery.nameArgs[].value.
meaning
|
integer
|
The
meaning
field is reserved and should not be used.
|
|
gqlQuery.nameArgs[].value.
indexed
|
boolean
|
If the value should be indexed.
The
indexed
property may be set for a
null
value. When
indexed
is
true
,
stringValue
is limited to 500 characters and the blob value is limited to 500 bytes. Input values by default have
indexed
set to
true
; however, you can explicitly set
indexed
to
true
if you want. (An output value never has
indexed
explicitly set to
true
.) If a value is itself an entity, it cannot have
indexed
set to
true
.
|
|
gqlQuery.nameArgs[].
cursor
|
bytes
|
||
gqlQuery.
numberArgs[]
|
list
|
Numbered binding site @1 references the first numbered argument, effectively using 1-based indexing, rather than the usual 0. A numbered argument must NOT set field GqlQueryArg.name. For each binding site numbered i in query_string, there must be an ith numbered argument. The inverse must also be true. | |
gqlQuery.numberArgs[].
name
|
string
|
Must match regex "[A-Za-z_$][A-Za-z_$0-9]*". Must not match regex "__.*__". Must not be "". | |
gqlQuery.numberArgs[].
value
|
nested object
|
||
gqlQuery.numberArgs[].value.
booleanValue
|
boolean
|
A boolean value. | |
gqlQuery.numberArgs[].value.
integerValue
|
long
|
An integer value. | |
gqlQuery.numberArgs[].value.
doubleValue
|
double
|
A double value. | |
gqlQuery.numberArgs[].value.
dateTimeValue
|
datetime
|
A timestamp value. | |
gqlQuery.numberArgs[].value.
keyValue
|
nested object
|
A key value. | |
gqlQuery.numberArgs[].value.keyValue.
partitionId
|
nested object
|
Entities are partitioned into subsets, currently identified by a dataset (usually implicitly specified by the project) and namespace ID. Queries are scoped to a single partition. | |
gqlQuery.numberArgs[].value.keyValue.partitionId.
datasetId
|
string
|
The dataset ID. | |
gqlQuery.numberArgs[].value.keyValue.partitionId.
namespace
|
string
|
The namespace. | |
gqlQuery.numberArgs[].value.keyValue.
path[]
|
list
|
The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity , the second element identifies a child of the root entity, the third element a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors . An entity path is always fully complete: ALL of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. A path can never be empty. | |
gqlQuery.numberArgs[].value.keyValue.path[].
kind
|
string
|
The kind of the entity. A kind matching regex "__.*__" is reserved/read-only. A kind must not contain more than 500 characters. Cannot be "". | |
gqlQuery.numberArgs[].value.keyValue.path[].
id
|
long
|
The ID of the entity. Never equal to zero. Values less than zero are discouraged and will not be supported in the future. | |
gqlQuery.numberArgs[].value.keyValue.path[].
name
|
string
|
The name of the entity. A name matching regex "__.*__" is reserved/read-only. A name must not be more than 500 characters. Cannot be "". | |
gqlQuery.numberArgs[].value.
blobKeyValue
|
string
|
A blob key value. | |
gqlQuery.numberArgs[].value.
stringValue
|
string
|
A UTF-8 encoded string value. | |
gqlQuery.numberArgs[].value.
blobValue
|
bytes
|
A blob value. | |
gqlQuery.numberArgs[].value.
entityValue
|
nested object
|
An entity value. May have no key. May have a key with an incomplete key path. May have a reserved/read-only key. | |
gqlQuery.numberArgs[].value.entityValue.
key
|
nested object
|
The entity's key.
An entity must have a key, unless otherwise documented (for example, an entity in
Value.entityValue
may have no key). An entity's kind is its key's path's last element's kind, or null if it has no key.
|
|
gqlQuery.numberArgs[].value.entityValue.key.
partitionId
|
nested object
|
Entities are partitioned into subsets, currently identified by a dataset (usually implicitly specified by the project) and namespace ID. Queries are scoped to a single partition. | |
gqlQuery.numberArgs[].value.entityValue.key.partitionId.
datasetId
|
string
|
The dataset ID. | |
gqlQuery.numberArgs[].value.entityValue.key.partitionId.
namespace
|
string
|
The namespace. | |
gqlQuery.numberArgs[].value.entityValue.key.
path[]
|
list
|
The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity , the second element identifies a child of the root entity, the third element a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors . An entity path is always fully complete: ALL of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. A path can never be empty. | |
gqlQuery.numberArgs[].value.entityValue.key.path[].
kind
|
string
|
The kind of the entity. A kind matching regex "__.*__" is reserved/read-only. A kind must not contain more than 500 characters. Cannot be "". | |
gqlQuery.numberArgs[].value.entityValue.key.path[].
id
|
long
|
The ID of the entity. Never equal to zero. Values less than zero are discouraged and will not be supported in the future. | |
gqlQuery.numberArgs[].value.entityValue.key.path[].
name
|
string
|
The name of the entity. A name matching regex "__.*__" is reserved/read-only. A name must not be more than 500 characters. Cannot be "". | |
gqlQuery.numberArgs[].value.entityValue.
properties
|
object
|
The entity's properties. | |
gqlQuery.numberArgs[].value.entityValue.properties.
(key)
|
nested object
|
The name of the property. A property name matching regex "__.*__" is reserved. A reserved property name is forbidden in certain documented contexts. The name must not contain more than 500 characters. Cannot be "". | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).
booleanValue
|
boolean
|
A boolean value. | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).
integerValue
|
long
|
An integer value. | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).
doubleValue
|
double
|
A double value. | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).
dateTimeValue
|
datetime
|
A timestamp value. | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).
keyValue
|
nested object
|
A key value. | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).keyValue.
partitionId
|
nested object
|
Entities are partitioned into subsets, currently identified by a dataset (usually implicitly specified by the project) and namespace ID. Queries are scoped to a single partition. | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).keyValue.partitionId.
datasetId
|
string
|
The dataset ID. | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).keyValue.partitionId.
namespace
|
string
|
The namespace. | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).keyValue.
path[]
|
list
|
The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity , the second element identifies a child of the root entity, the third element a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors . An entity path is always fully complete: ALL of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. A path can never be empty. | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).keyValue.path[].
kind
|
string
|
The kind of the entity. A kind matching regex "__.*__" is reserved/read-only. A kind must not contain more than 500 characters. Cannot be "". | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).keyValue.path[].
id
|
long
|
The ID of the entity. Never equal to zero. Values less than zero are discouraged and will not be supported in the future. | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).keyValue.path[].
name
|
string
|
The name of the entity. A name matching regex "__.*__" is reserved/read-only. A name must not be more than 500 characters. Cannot be "". | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).
blobKeyValue
|
string
|
A blob key value. | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).
stringValue
|
string
|
A UTF-8 encoded string value. | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).
blobValue
|
bytes
|
A blob value. | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).
entityValue
|
nested object
|
An entity value. May have no key. May have a key with an incomplete key path. May have a reserved/read-only key. | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).
listValue[]
|
list
|
A list value. Cannot contain another list value. Cannot also have a meaning and indexing set. | |
gqlQuery.numberArgs[].value.entityValue.properties.(key).
meaning
|
integer
|
The
meaning
field is reserved and should not be used.
|
|
gqlQuery.numberArgs[].value.entityValue.properties.(key).
indexed
|
boolean
|
If the value should be indexed.
The
indexed
property may be set for a
null
value. When
indexed
is
true
,
stringValue
is limited to 500 characters and the blob value is limited to 500 bytes. Input values by default have
indexed
set to
true
; however, you can explicitly set
indexed
to
true
if you want. (An output value never has
indexed
explicitly set to
true
.) If a value is itself an entity, it cannot have
indexed
set to
true
.
|
|
gqlQuery.numberArgs[].value.
listValue[]
|
list
|
A list value. Cannot contain another list value. Cannot also have a meaning and indexing set. | |
gqlQuery.numberArgs[].value.
meaning
|
integer
|
The
meaning
field is reserved and should not be used.
|
|
gqlQuery.numberArgs[].value.
indexed
|
boolean
|
If the value should be indexed.
The
indexed
property may be set for a
null
value. When
indexed
is
true
,
stringValue
is limited to 500 characters and the blob value is limited to 500 bytes. Input values by default have
indexed
set to
true
; however, you can explicitly set
indexed
to
true
if you want. (An output value never has
indexed
explicitly set to
true
.) If a value is itself an entity, it cannot have
indexed
set to
true
.
|
|
gqlQuery.numberArgs[].
cursor
|
bytes
|
Response
If successful, this method returns a response body with the following structure:
{ "header": { "kind": "datastore#responseHeader" }, "batch": { "entityResultType": string, "entityResults": [ { "entity": { "key": { "partitionId": { "datasetId": string, "namespace": string }, "path": [ { "kind": string, "id": long, "name": string } ] }, "properties": { (key): { "booleanValue": boolean, "integerValue": long, "doubleValue": double, "dateTimeValue": datetime, "keyValue": { "partitionId": { "datasetId": string, "namespace": string }, "path": [ { "kind": string, "id": long, "name": string } ] }, "blobKeyValue": string, "stringValue": string, "blobValue": bytes, "entityValue": (Entity), "listValue": [ { "booleanValue": boolean, "integerValue": long, "doubleValue": double, "dateTimeValue": datetime, "keyValue": { "partitionId": { "datasetId": string, "namespace": string }, "path": [ { "kind": string, "id": long, "name": string } ] }, "blobKeyValue": string, "stringValue": string, "blobValue": bytes, "entityValue": (Entity), "listValue": [ (Value) ], "meaning": integer, "indexed": boolean } ], "meaning": integer, "indexed": boolean } } } } ], "endCursor": bytes, "moreResults": string, "skippedResults": integer } }
Property name | Value | Description | Notes |
---|---|---|---|
header
|
nested object
|
||
header.
kind
|
string
|
Identifies what kind of resource this is. Value: the fixed string
"datastore#responseHeader"
.
|
|
batch
|
nested object
|
A batch of query results (always present). | |
batch.
entityResultType
|
string
|
The result type for every entity in entityResults.
full
for full entities,
projection
for entities with only projected properties,
keyOnly
for entities with only a key.
Acceptable values are:
|
|
batch.
entityResults[]
|
list
|
The results for this batch. | |
batch.entityResults[].
entity
|
nested object
|
The resulting entity. | |
batch.entityResults[].entity.
key
|
nested object
|
The entity's key.
An entity must have a key, unless otherwise documented (for example, an entity in
Value.entityValue
may have no key). An entity's kind is its key's path's last element's kind, or null if it has no key.
|
|
batch.entityResults[].entity.key.
partitionId
|
nested object
|
Entities are partitioned into subsets, currently identified by a dataset (usually implicitly specified by the project) and namespace ID. Queries are scoped to a single partition. | |
batch.entityResults[].entity.key.partitionId.
datasetId
|
string
|
The dataset ID. | |
batch.entityResults[].entity.key.partitionId.
namespace
|
string
|
The namespace. | |
batch.entityResults[].entity.key.
path[]
|
list
|
The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity , the second element identifies a child of the root entity, the third element a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors . An entity path is always fully complete: ALL of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. A path can never be empty. | |
batch.entityResults[].entity.key.path[].
kind
|
string
|
The kind of the entity. A kind matching regex "__.*__" is reserved/read-only. A kind must not contain more than 500 characters. Cannot be "". | |
batch.entityResults[].entity.key.path[].
id
|
long
|
The ID of the entity. Never equal to zero. Values less than zero are discouraged and will not be supported in the future. | |
batch.entityResults[].entity.key.path[].
name
|
string
|
The name of the entity. A name matching regex "__.*__" is reserved/read-only. A name must not be more than 500 characters. Cannot be "". | |
batch.entityResults[].entity.
properties
|
object
|
The entity's properties. | |
batch.entityResults[].entity.properties.
(key)
|
nested object
|
The name of the property. A property name matching regex "__.*__" is reserved. A reserved property name is forbidden in certain documented contexts. The name must not contain more than 500 characters. Cannot be "". | |
batch.entityResults[].entity.properties.(key).
booleanValue
|
boolean
|
A boolean value. | |
batch.entityResults[].entity.properties.(key).
integerValue
|
long
|
An integer value. | |
batch.entityResults[].entity.properties.(key).
doubleValue
|
double
|
A double value. | |
batch.entityResults[].entity.properties.(key).
dateTimeValue
|
datetime
|
A timestamp value. | |
batch.entityResults[].entity.properties.(key).
keyValue
|
nested object
|
A key value. | |
batch.entityResults[].entity.properties.(key).keyValue.
partitionId
|
nested object
|
Entities are partitioned into subsets, currently identified by a dataset (usually implicitly specified by the project) and namespace ID. Queries are scoped to a single partition. | |
batch.entityResults[].entity.properties.(key).keyValue.partitionId.
datasetId
|
string
|
The dataset ID. | |
batch.entityResults[].entity.properties.(key).keyValue.partitionId.
namespace
|
string
|
The namespace. | |
batch.entityResults[].entity.properties.(key).keyValue.
path[]
|
list
|
The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity , the second element identifies a child of the root entity, the third element a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors . An entity path is always fully complete: ALL of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. A path can never be empty. | |
batch.entityResults[].entity.properties.(key).keyValue.path[].
kind
|
string
|
The kind of the entity. A kind matching regex "__.*__" is reserved/read-only. A kind must not contain more than 500 characters. Cannot be "". | |
batch.entityResults[].entity.properties.(key).keyValue.path[].
id
|
long
|
The ID of the entity. Never equal to zero. Values less than zero are discouraged and will not be supported in the future. | |
batch.entityResults[].entity.properties.(key).keyValue.path[].
name
|
string
|
The name of the entity. A name matching regex "__.*__" is reserved/read-only. A name must not be more than 500 characters. Cannot be "". | |
batch.entityResults[].entity.properties.(key).
blobKeyValue
|
string
|
A blob key value. | |
batch.entityResults[].entity.properties.(key).
stringValue
|
string
|
A UTF-8 encoded string value. | |
batch.entityResults[].entity.properties.(key).
blobValue
|
bytes
|
A blob value. | |
batch.entityResults[].entity.properties.(key).
entityValue
|
nested object
|
An entity value. May have no key. May have a key with an incomplete key path. May have a reserved/read-only key. | |
batch.entityResults[].entity.properties.(key).
listValue[]
|
list
|
A list value. Cannot contain another list value. Cannot also have a meaning and indexing set. | |
batch.entityResults[].entity.properties.(key).listValue[].
booleanValue
|
boolean
|
A boolean value. | |
batch.entityResults[].entity.properties.(key).listValue[].
integerValue
|
long
|
An integer value. | |
batch.entityResults[].entity.properties.(key).listValue[].
doubleValue
|
double
|
A double value. | |
batch.entityResults[].entity.properties.(key).listValue[].
dateTimeValue
|
datetime
|
A timestamp value. | |
batch.entityResults[].entity.properties.(key).listValue[].
keyValue
|
nested object
|
A key value. | |
batch.entityResults[].entity.properties.(key).listValue[].keyValue.
partitionId
|
nested object
|
Entities are partitioned into subsets, currently identified by a dataset (usually implicitly specified by the project) and namespace ID. Queries are scoped to a single partition. | |
batch.entityResults[].entity.properties.(key).listValue[].keyValue.partitionId.
datasetId
|
string
|
The dataset ID. | |
batch.entityResults[].entity.properties.(key).listValue[].keyValue.partitionId.
namespace
|
string
|
The namespace. | |
batch.entityResults[].entity.properties.(key).listValue[].keyValue.
path[]
|
list
|
The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a root entity , the second element identifies a child of the root entity, the third element a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's ancestors . An entity path is always fully complete: ALL of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. A path can never be empty. | |
batch.entityResults[].entity.properties.(key).listValue[].keyValue.path[].
kind
|
string
|
The kind of the entity. A kind matching regex "__.*__" is reserved/read-only. A kind must not contain more than 500 characters. Cannot be "". | |
batch.entityResults[].entity.properties.(key).listValue[].keyValue.path[].
id
|
long
|
The ID of the entity. Never equal to zero. Values less than zero are discouraged and will not be supported in the future. | |
batch.entityResults[].entity.properties.(key).listValue[].keyValue.path[].
name
|
string
|
The name of the entity. A name matching regex "__.*__" is reserved/read-only. A name must not be more than 500 characters. Cannot be "". | |
batch.entityResults[].entity.properties.(key).listValue[].
blobKeyValue
|
string
|
A blob key value. | |
batch.entityResults[].entity.properties.(key).listValue[].
stringValue
|
string
|
A UTF-8 encoded string value. | |
batch.entityResults[].entity.properties.(key).listValue[].
blobValue
|
bytes
|
A blob value. | |
batch.entityResults[].entity.properties.(key).listValue[].
entityValue
|
nested object
|
An entity value. May have no key. May have a key with an incomplete key path. May have a reserved/read-only key. | |
batch.entityResults[].entity.properties.(key).listValue[].
listValue[]
|
list
|
A list value. Cannot contain another list value. Cannot also have a meaning and indexing set. | |
batch.entityResults[].entity.properties.(key).listValue[].
meaning
|
integer
|
The
meaning
field is reserved and should not be used.
|
|
batch.entityResults[].entity.properties.(key).listValue[].
indexed
|
boolean
|
If the value should be indexed.
The
indexed
property may be set for a
null
value. When
indexed
is
true
,
stringValue
is limited to 500 characters and the blob value is limited to 500 bytes. Input values by default have
indexed
set to
true
; however, you can explicitly set
indexed
to
true
if you want. (An output value never has
indexed
explicitly set to
true
.) If a value is itself an entity, it cannot have
indexed
set to
true
.
|
|
batch.entityResults[].entity.properties.(key).
meaning
|
integer
|
The
meaning
field is reserved and should not be used.
|
|
batch.entityResults[].entity.properties.(key).
indexed
|
boolean
|
If the value should be indexed.
The
indexed
property may be set for a
null
value. When
indexed
is
true
,
stringValue
is limited to 500 characters and the blob value is limited to 500 bytes. Input values by default have
indexed
set to
true
; however, you can explicitly set
indexed
to
true
if you want. (An output value never has
indexed
explicitly set to
true
.) If a value is itself an entity, it cannot have
indexed
set to
true
.
|
|
batch.
endCursor
|
bytes
|
A cursor that points to the position after the last result in the batch. May be absent. | |
batch.
moreResults
|
string
|
The state of the query after the current batch. One of
notFinished
,
moreResultsAfterLimit
,
noMoreResults
.
Acceptable values are:
|
|
batch.
skippedResults
|
integer
|
The number of results skipped because of
Query.offset
.
|
Try it!
Use the APIs Explorer below to call this method on live data and see the response. Alternatively, try the standalone Explorer .