Properties

static

Direction  number

The sort direction.

Properties

Name Type Optional Description

DIRECTION_UNSPECIFIED

 

 

Unspecified. This value must not be used.

ASCENDING

 

 

Ascending.

DESCENDING

 

 

Descending.

static

Mode  number

The modes available for commits.

Properties

Name Type Optional Description

MODE_UNSPECIFIED

 

 

Unspecified. This value must not be used.

TRANSACTIONAL

 

 

Transactional: The mutations are either all applied, or none are applied. Learn about transactions here.

NON_TRANSACTIONAL

 

 

Non-transactional: The mutations may not apply as all or none.

static

MoreResultsType  number

The possible values for the more_results field.

Properties

Name Type Optional Description

MORE_RESULTS_TYPE_UNSPECIFIED

 

 

Unspecified. This value is never used.

NOT_FINISHED

 

 

There may be additional batches to fetch from this query.

MORE_RESULTS_AFTER_LIMIT

 

 

The query is finished, but there may be more results after the limit.

MORE_RESULTS_AFTER_CURSOR

 

 

The query is finished, but there may be more results after the end cursor.

NO_MORE_RESULTS

 

 

The query is finished, and there are no more results.

static

Operator  number

A composite filter operator.

Properties

Name Type Optional Description

OPERATOR_UNSPECIFIED

 

 

Unspecified. This value must not be used.

AND

 

 

The results are required to satisfy each of the combined filters.

static

Operator  number

A property filter operator.

Properties

Name Type Optional Description

OPERATOR_UNSPECIFIED

 

 

Unspecified. This value must not be used.

LESS_THAN

 

 

Less than.

LESS_THAN_OR_EQUAL

 

 

Less than or equal.

GREATER_THAN

 

 

Greater than.

GREATER_THAN_OR_EQUAL

 

 

Greater than or equal.

EQUAL

 

 

Equal.

HAS_ANCESTOR

 

 

Has ancestor.

static

ReadConsistency  number

The possible values for read consistencies.

Properties

Name Type Optional Description

READ_CONSISTENCY_UNSPECIFIED

 

 

Unspecified. This value must not be used.

STRONG

 

 

Strong consistency.

EVENTUAL

 

 

Eventual consistency.

static

ResultType  number

Specifies what data the 'entity' field contains. A ResultType is either implied (for example, in LookupResponse.missing from datastore.proto, it is always KEY_ONLY) or specified by context (for example, in message QueryResultBatch, field entity_result_type specifies a ResultType for all the values in field entity_results).

Properties

Name Type Optional Description

RESULT_TYPE_UNSPECIFIED

 

 

Unspecified. This value is never used.

FULL

 

 

The key and properties.

PROJECTION

 

 

A projected subset of properties. The entity may have no key.

KEY_ONLY

 

 

Only the key.

Abstract types

static

AllocateIdsRequest

The request for Datastore.AllocateIds.

Properties

Name Type Optional Description

projectId

string

 

The ID of the project against which to make the request.

keys

Array of Object

 

A list of keys with incomplete key paths for which to allocate IDs. No key may be reserved/read-only.

This object should have the same structure as Key

See also

google.datastore.v1.AllocateIdsRequest definition in proto format

static

AllocateIdsResponse

The response for Datastore.AllocateIds.

Property

Name Type Optional Description

keys

Array of Object

 

The keys specified in the request (in the same order), each with its key path completed with a newly allocated ID.

This object should have the same structure as Key

See also

google.datastore.v1.AllocateIdsResponse definition in proto format

static

ArrayValue

An array value.

Property

Name Type Optional Description

values

Array of Object

 

Values in the array. The order of this array may not be preserved if it contains a mix of indexed and unindexed values.

This object should have the same structure as Value

See also

google.datastore.v1.ArrayValue definition in proto format

static

BeginTransactionRequest

The request for Datastore.BeginTransaction.

Properties

Name Type Optional Description

projectId

string

 

The ID of the project against which to make the request.

transactionOptions

Object

 

Options for a new transaction.

This object should have the same structure as TransactionOptions

See also

google.datastore.v1.BeginTransactionRequest definition in proto format

static

BeginTransactionResponse

The response for Datastore.BeginTransaction.

Property

Name Type Optional Description

transaction

string

 

The transaction identifier (always present).

See also

google.datastore.v1.BeginTransactionResponse definition in proto format

static

CommitRequest

The request for Datastore.Commit.

Properties

Name Type Optional Description

projectId

string

 

The ID of the project against which to make the request.

mode

number

 

The type of commit to perform. Defaults to TRANSACTIONAL.

The number should be among the values of Mode

transaction

string

 

The identifier of the transaction associated with the commit. A transaction identifier is returned by a call to Datastore.BeginTransaction.

mutations

Array of Object

 

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

This object should have the same structure as Mutation

See also

google.datastore.v1.CommitRequest definition in proto format

static

CommitResponse

The response for Datastore.Commit.

Properties

Name Type Optional Description

mutationResults

Array of Object

 

The result of performing the mutations. The i-th mutation result corresponds to the i-th mutation in the request.

This object should have the same structure as MutationResult

indexUpdates

number

 

The number of index entries updated during the commit, or zero if none were updated.

See also

google.datastore.v1.CommitResponse definition in proto format

static

CompositeFilter

A filter that merges multiple other filters using the given operator.

Properties

Name Type Optional Description

op

number

 

The operator for combining multiple filters.

The number should be among the values of Operator

filters

Array of Object

 

The list of filters to combine. Must contain at least one filter.

This object should have the same structure as Filter

See also

google.datastore.v1.CompositeFilter definition in proto format

static

Entity

A Datastore data object.

An entity is limited to 1 megabyte when stored. That roughly corresponds to a limit of 1 megabyte for the serialized form of this message.

Properties

Name Type Optional Description

key

Object

 

The entity's key.

An entity must have a key, unless otherwise documented (for example, an entity in Value.entity_value may have no key). An entity's kind is its key path's last element's kind, or null if it has no key.

This object should have the same structure as Key

properties

Object with Object properties

 

The entity's properties. The map's keys are property names. 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. The name cannot be "".

See also

google.datastore.v1.Entity definition in proto format

static

EntityResult

The result of fetching an entity from Datastore.

Properties

Name Type Optional Description

entity

Object

 

The resulting entity.

This object should have the same structure as Entity

version

number

 

The version of the entity, a strictly positive number that monotonically increases with changes to the entity.

This field is set for FULL entity results.

For missing entities in LookupResponse, this is the version of the snapshot that was used to look up the entity, and it is always set except for eventually consistent reads.

cursor

string

 

A cursor that points to the position after the result entity. Set only when the EntityResult is part of a QueryResultBatch message.

See also

google.datastore.v1.EntityResult definition in proto format

static

Filter

A holder for any type of filter.

Properties

Name Type Optional Description

compositeFilter

Object

 

A composite filter.

This object should have the same structure as CompositeFilter

propertyFilter

Object

 

A filter on a property.

This object should have the same structure as PropertyFilter

See also

google.datastore.v1.Filter definition in proto format

static

GqlQuery

A GQL query.

Properties

Name Type Optional Description

queryString

string

 

A string of the format described here.

allowLiterals

boolean

 

When false, the query string must not contain any literals and instead must bind all values. For example, SELECT * FROM Kind WHERE a = 'string literal' is not allowed, while SELECT * FROM Kind WHERE a = @value is.

namedBindings

Object with Object properties

 

For each non-reserved named binding site in the query string, there must be a named parameter with that name, but not necessarily the inverse.

Key must match regex [A-Za-z_$][A-Za-z_$0-9]*, must not match regex __.*__, and must not be "".

positionalBindings

Array of Object

 

Numbered binding site @1 references the first numbered parameter, effectively using 1-based indexing, rather than the usual 0.

For each binding site numbered i in query_string, there must be an i-th numbered parameter. The inverse must also be true.

This object should have the same structure as GqlQueryParameter

See also

google.datastore.v1.GqlQuery definition in proto format

static

GqlQueryParameter

A binding parameter for a GQL query.

Properties

Name Type Optional Description

value

Object

 

A value parameter.

This object should have the same structure as Value

cursor

string

 

A query cursor. Query cursors are returned in query result batches.

See also

google.datastore.v1.GqlQueryParameter definition in proto format

static

Key

A unique identifier for an entity. If a key's partition ID or any of its path kinds or names are reserved/read-only, the key is reserved/read-only. A reserved/read-only key is forbidden in certain documented contexts.

Properties

Name Type Optional Description

partitionId

Object

 

Entities are partitioned into subsets, currently identified by a project ID and namespace ID. Queries are scoped to a single partition.

This object should have the same structure as PartitionId

path

Array of Object

 

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 identifies 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. For example, the last path element of the key of Mutation.insert may have no identifier.

A path can never be empty, and a path can have at most 100 elements.

This object should have the same structure as PathElement

See also

google.datastore.v1.Key definition in proto format

static

KindExpression

A representation of a kind.

Property

Name Type Optional Description

name

string

 

The name of the kind.

See also

google.datastore.v1.KindExpression definition in proto format

static

LookupRequest

The request for Datastore.Lookup.

Properties

Name Type Optional Description

projectId

string

 

The ID of the project against which to make the request.

readOptions

Object

 

The options for this lookup request.

This object should have the same structure as ReadOptions

keys

Array of Object

 

Keys of entities to look up.

This object should have the same structure as Key

See also

google.datastore.v1.LookupRequest definition in proto format

static

LookupResponse

The response for Datastore.Lookup.

Properties

Name Type Optional Description

found

Array of Object

 

Entities found as ResultType.FULL entities. The order of results in this field is undefined and has no relation to the order of the keys in the input.

This object should have the same structure as EntityResult

missing

Array of Object

 

Entities not found as ResultType.KEY_ONLY entities. The order of results in this field is undefined and has no relation to the order of the keys in the input.

This object should have the same structure as EntityResult

deferred

Array of Object

 

A list of keys that were not looked up due to resource constraints. The order of results in this field is undefined and has no relation to the order of the keys in the input.

This object should have the same structure as Key

See also

google.datastore.v1.LookupResponse definition in proto format

static

Mutation

A mutation to apply to an entity.

Properties

Name Type Optional Description

insert

Object

 

The entity to insert. The entity must not already exist. The entity key's final path element may be incomplete.

This object should have the same structure as Entity

update

Object

 

The entity to update. The entity must already exist. Must have a complete key path.

This object should have the same structure as Entity

upsert

Object

 

The entity to upsert. The entity may or may not already exist. The entity key's final path element may be incomplete.

This object should have the same structure as Entity

delete

Object

 

The key of the entity to delete. The entity may or may not already exist. Must have a complete key path and must not be reserved/read-only.

This object should have the same structure as Key

baseVersion

number

 

The version of the entity that this mutation is being applied to. If this does not match the current version on the server, the mutation conflicts.

See also

google.datastore.v1.Mutation definition in proto format

static

MutationResult

The result of applying a mutation.

Properties

Name Type Optional Description

key

Object

 

The automatically allocated key. Set only when the mutation allocated a key.

This object should have the same structure as Key

version

number

 

The version of the entity on the server after processing the mutation. If the mutation doesn't change anything on the server, then the version will be the version of the current entity or, if no entity is present, a version that is strictly greater than the version of any previous entity and less than the version of any possible future entity.

conflictDetected

boolean

 

Whether a conflict was detected for this mutation. Always false when a conflict detection strategy field is not set in the mutation.

See also

google.datastore.v1.MutationResult definition in proto format

static

PartitionId

A partition ID identifies a grouping of entities. The grouping is always by project and namespace, however the namespace ID may be empty.

A partition ID contains several dimensions: project ID and namespace ID.

Partition dimensions:

  • May be "".
  • Must be valid UTF-8 bytes.
  • Must have values that match regex [A-Za-z\d\.\-_]{1,100} If the value of any dimension matches regex __.*__, the partition is reserved/read-only. A reserved/read-only partition ID is forbidden in certain documented contexts.

Foreign partition IDs (in which the project ID does not match the context project ID ) are discouraged. Reads and writes of foreign partition IDs may fail if the project is not in an active state.

Properties

Name Type Optional Description

projectId

string

 

The ID of the project to which the entities belong.

namespaceId

string

 

If not empty, the ID of the namespace to which the entities belong.

See also

google.datastore.v1.PartitionId definition in proto format

static

PathElement

A (kind, ID/name) pair used to construct a key path.

If either name or ID is set, the element is complete. If neither is set, the element is incomplete.

Properties

Name Type Optional Description

kind

string

 

The kind of the entity. A kind matching regex __.*__ is reserved/read-only. A kind must not contain more than 1500 bytes when UTF-8 encoded. Cannot be "".

id

number

 

The auto-allocated ID of the entity. Never equal to zero. Values less than zero are discouraged and may not be supported in the future.

name

string

 

The name of the entity. A name matching regex __.*__ is reserved/read-only. A name must not be more than 1500 bytes when UTF-8 encoded. Cannot be "".

See also

google.datastore.v1.Key.PathElement definition in proto format

static

Projection

A representation of a property in a projection.

Property

Name Type Optional Description

property

Object

 

The property to project.

This object should have the same structure as PropertyReference

See also

google.datastore.v1.Projection definition in proto format

static

PropertyFilter

A filter on a specific property.

Properties

Name Type Optional Description

property

Object

 

The property to filter by.

This object should have the same structure as PropertyReference

op

number

 

The operator to filter by.

The number should be among the values of Operator

value

Object

 

The value to compare the property to.

This object should have the same structure as Value

See also

google.datastore.v1.PropertyFilter definition in proto format

static

PropertyOrder

The desired order for a specific property.

Properties

Name Type Optional Description

property

Object

 

The property to order by.

This object should have the same structure as PropertyReference

direction

number

 

The direction to order by. Defaults to ASCENDING.

The number should be among the values of Direction

See also

google.datastore.v1.PropertyOrder definition in proto format

static

PropertyReference

A reference to a property relative to the kind expressions.

Property

Name Type Optional Description

name

string

 

The name of the property. If name includes "."s, it may be interpreted as a property name path.

See also

google.datastore.v1.PropertyReference definition in proto format

static

Query

A query for entities.

Properties

Name Type Optional Description

projection

Array of Object

 

The projection to return. Defaults to returning all properties.

This object should have the same structure as Projection

kind

Array of Object

 

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

This object should have the same structure as KindExpression

filter

Object

 

The filter to apply.

This object should have the same structure as Filter

order

Array of Object

 

The order to apply to the query results (if empty, order is unspecified).

This object should have the same structure as PropertyOrder

distinctOn

Array of Object

 

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).

This object should have the same structure as PropertyReference

startCursor

string

 

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.

endCursor

string

 

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.

offset

number

 

The number of results to skip. Applies before limit, but after all other constraints. Optional. Must be >= 0 if specified.

limit

Object

 

The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.

This object should have the same structure as Int32Value

See also

google.datastore.v1.Query definition in proto format

static

QueryResultBatch

A batch of results produced by a query.

Properties

Name Type Optional Description

skippedResults

number

 

The number of results skipped, typically because of an offset.

skippedCursor

string

 

A cursor that points to the position after the last skipped result. Will be set when skipped_results != 0.

entityResultType

number

 

The result type for every entity in entity_results.

The number should be among the values of ResultType

entityResults

Array of Object

 

The results for this batch.

This object should have the same structure as EntityResult

endCursor

string

 

A cursor that points to the position after the last result in the batch.

moreResults

number

 

The state of the query after the current batch.

The number should be among the values of MoreResultsType

snapshotVersion

number

 

The version number of the snapshot this batch was returned from. This applies to the range of results from the query's start_cursor (or the beginning of the query if no cursor was given) to this batch's end_cursor (not the query's end_cursor).

In a single transaction, subsequent query result batches for the same query can have a greater snapshot version number. Each batch's snapshot version is valid for all preceding batches. The value will be zero for eventually consistent queries.

See also

google.datastore.v1.QueryResultBatch definition in proto format

static

ReadOnly

Options specific to read-only transactions.

See also

google.datastore.v1.TransactionOptions.ReadOnly definition in proto format

static

ReadOptions

The options shared by read requests.

Properties

Name Type Optional Description

readConsistency

number

 

The non-transactional read consistency to use. Cannot be set to STRONG for global queries.

The number should be among the values of ReadConsistency

transaction

string

 

The identifier of the transaction in which to read. A transaction identifier is returned by a call to Datastore.BeginTransaction.

See also

google.datastore.v1.ReadOptions definition in proto format

static

ReadWrite

Options specific to read / write transactions.

Property

Name Type Optional Description

previousTransaction

string

 

The transaction identifier of the transaction being retried.

See also

google.datastore.v1.TransactionOptions.ReadWrite definition in proto format

static

ReserveIdsRequest

The request for Datastore.ReserveIds.

Properties

Name Type Optional Description

projectId

string

 

The ID of the project against which to make the request.

databaseId

string

 

If not empty, the ID of the database against which to make the request.

keys

Array of Object

 

A list of keys with complete key paths whose numeric IDs should not be auto-allocated.

This object should have the same structure as Key

See also

google.datastore.v1.ReserveIdsRequest definition in proto format

static

ReserveIdsResponse

The response for Datastore.ReserveIds.

See also

google.datastore.v1.ReserveIdsResponse definition in proto format

static

RollbackRequest

The request for Datastore.Rollback.

Properties

Name Type Optional Description

projectId

string

 

The ID of the project against which to make the request.

transaction

string

 

The transaction identifier, returned by a call to Datastore.BeginTransaction.

See also

google.datastore.v1.RollbackRequest definition in proto format

static

RollbackResponse

The response for Datastore.Rollback. (an empty message).

See also

google.datastore.v1.RollbackResponse definition in proto format

static

RunQueryRequest

The request for Datastore.RunQuery.

Properties

Name Type Optional Description

projectId

string

 

The ID of the project against which to make the request.

partitionId

Object

 

Entities are partitioned into subsets, identified by a partition ID. Queries are scoped to a single partition. This partition ID is normalized with the standard default context partition ID.

This object should have the same structure as PartitionId

readOptions

Object

 

The options for this query.

This object should have the same structure as ReadOptions

query

Object

 

The query to run.

This object should have the same structure as Query

gqlQuery

Object

 

The GQL query to run.

This object should have the same structure as GqlQuery

See also

google.datastore.v1.RunQueryRequest definition in proto format

static

RunQueryResponse

The response for Datastore.RunQuery.

Properties

Name Type Optional Description

batch

Object

 

A batch of query results (always present).

This object should have the same structure as QueryResultBatch

query

Object

 

The parsed form of the GqlQuery from the request, if it was set.

This object should have the same structure as Query

See also

google.datastore.v1.RunQueryResponse definition in proto format

static

TransactionOptions

Options for beginning a new transaction.

Transactions can be created explicitly with calls to Datastore.BeginTransaction or implicitly by setting ReadOptions.new_transaction in read requests.

Properties

Name Type Optional Description

readWrite

Object

 

The transaction should allow both reads and writes.

This object should have the same structure as ReadWrite

readOnly

Object

 

The transaction should only allow reads.

This object should have the same structure as ReadOnly

See also

google.datastore.v1.TransactionOptions definition in proto format

static

Value

A message that can hold any of the supported value types and associated metadata.

Properties

Name Type Optional Description

nullValue

number

 

A null value.

The number should be among the values of NullValue

booleanValue

boolean

 

A boolean value.

integerValue

number

 

An integer value.

doubleValue

number

 

A double value.

timestampValue

Object

 

A timestamp value. When stored in the Datastore, precise only to microseconds; any additional precision is rounded down.

This object should have the same structure as Timestamp

keyValue

Object

 

A key value.

This object should have the same structure as Key

stringValue

string

 

A UTF-8 encoded string value. When exclude_from_indexes is false (it is indexed) , may have at most 1500 bytes. Otherwise, may be set to at least 1,000,000 bytes.

blobValue

string

 

A blob value. May have at most 1,000,000 bytes. When exclude_from_indexes is false, may have at most 1500 bytes. In JSON requests, must be base64-encoded.

geoPointValue

Object

 

A geo point value representing a point on the surface of Earth.

This object should have the same structure as LatLng

entityValue

Object

 

An entity value.

  • May have no key.
  • May have a key with an incomplete key path.
  • May have a reserved/read-only key.

This object should have the same structure as Entity

arrayValue

Object

 

An array value. Cannot contain another array value. A Value instance that sets field array_value must not set fields meaning or exclude_from_indexes.

This object should have the same structure as ArrayValue

meaning

number

 

The meaning field should only be populated for backwards compatibility.

excludeFromIndexes

boolean

 

If the value should be excluded from all indexes including those defined explicitly.

See also

google.datastore.v1.Value definition in proto format