← Back to packages

Package google.datastore.v1

Service Datastore

Message Aggregation

Message AggregationQuery

Message AggregationResult

Message AggregationResultBatch

Message AllocateIdsRequest

Message AllocateIdsResponse

Message ArrayValue

Message Avg

Message BeginTransactionRequest

Message BeginTransactionResponse

Message CommitRequest

Message CommitResponse

Message CompositeFilter

Message Count

Message Entity

Message EntityResult

Message Filter

Message GqlQuery

Message GqlQueryParameter

Message Key

Message KindExpression

Message LookupRequest

Message LookupResponse

Message Mutation

Message MutationResult

Message PartitionId

Message PathElement

Message Projection

Message PropertyFilter

Message PropertyOrder

Message PropertyReference

Message Query

Message QueryResultBatch

Message ReadOnly

Message ReadOptions

Message ReadWrite

Message ReserveIdsRequest

Message ReserveIdsResponse

Message RollbackRequest

Message RollbackResponse

Message RunAggregationQueryRequest

Message RunAggregationQueryResponse

Message RunQueryRequest

Message RunQueryResponse

Message Sum

Message TransactionOptions

Message Value

Enum Direction

Enum Mode

Enum MoreResultsType

Enum Operator

Enum Operator

Enum ReadConsistency

Enum ResultType

Services

service Datastore google/datastore/v1/datastore.proto

Each RPC normalizes the partition IDs of the keys in its input entities, and always returns entities with keys with normalized partition IDs. This applies to all keys and entities, including those in values, except keys with both an empty path and an empty or unset partition ID. Normalization of input keys sets the project ID (if not already set) to the project ID from the request.

Commits a transaction, optionally creating, deleting or modifying some entities.

Allocates IDs for the given keys, which is useful for referencing an entity before it is inserted.

Prevents the supplied keys' IDs from being auto-allocated by Cloud Datastore.

Messages

message Aggregation (Nested in google.datastore.v1.AggregationQuery ) google/datastore/v1/query.proto

Defines an aggregation that produces a single result.

Field Type Description
7 alias string

Optional. Optional name of the property to store the result of the aggregation.

If not provided, Datastore will pick a default name following the format property_<incremental_id++>. For example:

AGGREGATE
  COUNT_UP_TO(1) AS count_up_to_1,
  COUNT_UP_TO(2),
  COUNT_UP_TO(3) AS count_up_to_3,
  COUNT(*)
OVER (
  ...
);

becomes:

AGGREGATE
  COUNT_UP_TO(1) AS count_up_to_1,
  COUNT_UP_TO(2) AS property_1,
  COUNT_UP_TO(3) AS count_up_to_3,
  COUNT(*) AS property_2
OVER (
  ...
);

Requires:

  • Must be unique across all aggregation aliases.
  • Conform to [entity property name][google.datastore.v1.Entity.properties] limitations.
oneof operator
1 count google.datastore.v1.AggregationQuery.Aggregation.Count

Count aggregator.

2 sum google.datastore.v1.AggregationQuery.Aggregation.Sum

Sum aggregator.

3 avg google.datastore.v1.AggregationQuery.Aggregation.Avg

Average aggregator.

message AggregationQuery google/datastore/v1/query.proto

Datastore query for running an aggregation over a [Query][google.datastore.v1.Query].

Field Type Description
3 aggregations repeated google.datastore.v1.AggregationQuery.Aggregation

Optional. Series of aggregations to apply over the results of the nested_query.

Requires:

  • A minimum of one and maximum of five aggregations per query.
oneof query_type
1 nested_query google.datastore.v1.Query

Nested query for aggregation

message AggregationResult google/datastore/v1/aggregation_result.proto

The result of a single bucket from a Datastore aggregation query.

The keys of aggregate_properties are the same for all results in an aggregation query, unlike entity queries which can have different fields present for each result.

Field Type Description
2 aggregate_properties map<string, Value>

The result of the aggregation functions, ex: COUNT(*) AS total_entities.

The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] assigned to the aggregation function on input and the size of this map equals the number of aggregation functions in the query.

message AggregationResultBatch google/datastore/v1/aggregation_result.proto

A batch of aggregation results produced by an aggregation query.

Field Type Description
1 aggregation_results repeated google.datastore.v1.AggregationResult

The aggregation results for this batch.

2 more_results google.datastore.v1.QueryResultBatch.MoreResultsType

The state of the query after the current batch. Only COUNT(*) aggregations are supported in the initial launch. Therefore, expected result type is limited to NO_MORE_RESULTS.

3 read_time google.protobuf.Timestamp

Read timestamp this batch was returned from.

In a single transaction, subsequent query result batches for the same query can have a greater timestamp. Each batch's read timestamp is valid for all preceding batches.

message AllocateIdsRequest google/datastore/v1/datastore.proto

The request for [Datastore.AllocateIds][google.datastore.v1.Datastore.AllocateIds].

Field Type Description
1 keys repeated google.datastore.v1.Key

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

8 project_id string

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

9 database_id string

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

'(default)' is not allowed; please use empty string '' to refer the default database.

message AllocateIdsResponse google/datastore/v1/datastore.proto

The response for [Datastore.AllocateIds][google.datastore.v1.Datastore.AllocateIds].

Field Type Description
1 keys repeated google.datastore.v1.Key

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

message ArrayValue google/datastore/v1/entity.proto

An array value.

Field Type Description
1 values repeated google.datastore.v1.Value

Values in the array. The order of values in an array is preserved as long as all values have identical settings for 'exclude_from_indexes'.

message Avg (Nested in google.datastore.v1.AggregationQuery.Aggregation ) google/datastore/v1/query.proto

Average of the values of the requested property.

  • Only numeric values will be aggregated. All non-numeric values including NULL are skipped.

  • If the aggregated values contain NaN, returns NaN. Infinity math follows IEEE-754 standards.

  • If the aggregated value set is empty, returns NULL.

  • Always returns the result as a double.

Field Type Description
1 property google.datastore.v1.PropertyReference

The property to aggregate on.

message BeginTransactionRequest google/datastore/v1/datastore.proto

The request for [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction].

Field Type Description
8 project_id string

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

9 database_id string

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

'(default)' is not allowed; please use empty string '' to refer the default database.

10 transaction_options google.datastore.v1.TransactionOptions

Options for a new transaction.

message BeginTransactionResponse google/datastore/v1/datastore.proto

The response for [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction].

Field Type Description
1 transaction bytes

The transaction identifier (always present).

message CommitRequest google/datastore/v1/datastore.proto

The request for [Datastore.Commit][google.datastore.v1.Datastore.Commit].

Field Type Description
5 mode google.datastore.v1.CommitRequest.Mode

The type of commit to perform. Defaults to TRANSACTIONAL.

6 mutations repeated google.datastore.v1.Mutation

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.

8 project_id string

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

9 database_id string

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

'(default)' is not allowed; please use empty string '' to refer the default database.

oneof transaction_selector
1 transaction bytes

The identifier of the transaction associated with the commit. A transaction identifier is returned by a call to [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction].

10 single_use_transaction google.datastore.v1.TransactionOptions

Options for beginning a new transaction for this request. The transaction is committed when the request completes. If specified, [TransactionOptions.mode][google.datastore.v1.TransactionOptions] must be [TransactionOptions.ReadWrite][google.datastore.v1.TransactionOptions.ReadWrite].

message CommitResponse google/datastore/v1/datastore.proto

The response for [Datastore.Commit][google.datastore.v1.Datastore.Commit].

Field Type Description
3 mutation_results repeated google.datastore.v1.MutationResult

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

4 index_updates int32

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

8 commit_time google.protobuf.Timestamp

The transaction commit timestamp. Not set for non-transactional commits.

message CompositeFilter google/datastore/v1/query.proto

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

Field Type Description
1 op google.datastore.v1.CompositeFilter.Operator

The operator for combining multiple filters.

2 filters repeated google.datastore.v1.Filter

The list of filters to combine.

Requires:

  • At least one filter is present.

message Count (Nested in google.datastore.v1.AggregationQuery.Aggregation ) google/datastore/v1/query.proto

Count of entities that match the query.

The COUNT(*) aggregation function operates on the entire entity so it does not require a field reference.

Field Type Description
1 up_to google.protobuf.Int64Value

Optional. Optional constraint on the maximum number of entities to count.

This provides a way to set an upper bound on the number of entities to scan, limiting latency, and cost.

Unspecified is interpreted as no bound.

If a zero value is provided, a count result of zero should always be expected.

High-Level Example:

AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k );

Requires:

  • Must be non-negative when present.

message Entity google/datastore/v1/entity.proto

A Datastore data object.

Must not exceed 1 MiB - 4 bytes.

Field Type Description
1 key google.datastore.v1.Key

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.

3 properties map<string, Value>

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 map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.

message EntityResult google/datastore/v1/query.proto

The result of fetching an entity from Datastore.

Field Type Description
1 entity google.datastore.v1.Entity

The resulting entity.

3 cursor bytes

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

4 version int64

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

This field is set for [FULL][google.datastore.v1.EntityResult.ResultType.FULL] entity results.

For [missing][google.datastore.v1.LookupResponse.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.

5 update_time google.protobuf.Timestamp

The time at which the entity was last changed. This field is set for [FULL][google.datastore.v1.EntityResult.ResultType.FULL] entity results. If this entity is missing, this field will not be set.

6 create_time google.protobuf.Timestamp

The time at which the entity was created. This field is set for [FULL][google.datastore.v1.EntityResult.ResultType.FULL] entity results. If this entity is missing, this field will not be set.

message Filter google/datastore/v1/query.proto

A holder for any type of filter.

Field Type Description
oneof filter_type
1 composite_filter google.datastore.v1.CompositeFilter

A composite filter.

2 property_filter google.datastore.v1.PropertyFilter

A filter on a property.

message GqlQuery google/datastore/v1/query.proto

Field Type Description
1 query_string string

A string of the format described here.

2 allow_literals bool

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.

4 positional_bindings repeated google.datastore.v1.GqlQueryParameter

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.

5 named_bindings map<string, GqlQueryParameter>

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

message GqlQueryParameter google/datastore/v1/query.proto

A binding parameter for a GQL query.

Field Type Description
oneof parameter_type
2 value google.datastore.v1.Value

A value parameter.

3 cursor bytes

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

message Key google/datastore/v1/entity.proto

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.

Field Type Description
1 partition_id google.datastore.v1.PartitionId

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

2 path repeated google.datastore.v1.Key.PathElement

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.

message KindExpression google/datastore/v1/query.proto

A representation of a kind.

Field Type Description
1 name string

The name of the kind.

message LookupRequest google/datastore/v1/datastore.proto

The request for [Datastore.Lookup][google.datastore.v1.Datastore.Lookup].

Field Type Description
1 read_options google.datastore.v1.ReadOptions

The options for this lookup request.

3 keys repeated google.datastore.v1.Key

Required. Keys of entities to look up.

8 project_id string

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

9 database_id string

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

'(default)' is not allowed; please use empty string '' to refer the default database.

message LookupResponse google/datastore/v1/datastore.proto

The response for [Datastore.Lookup][google.datastore.v1.Datastore.Lookup].

Field Type Description
1 found repeated google.datastore.v1.EntityResult

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.

2 missing repeated google.datastore.v1.EntityResult

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.

3 deferred repeated google.datastore.v1.Key

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.

5 transaction bytes

The identifier of the transaction that was started as part of this Lookup request.

Set only when [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] was set in [LookupRequest.read_options][google.datastore.v1.LookupRequest.read_options].

7 read_time google.protobuf.Timestamp

The time at which these entities were read or found missing.

message Mutation google/datastore/v1/datastore.proto

A mutation to apply to an entity.

Field Type Description
oneof conflict_detection_strategy
8 base_version int64

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.

11 update_time google.protobuf.Timestamp

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

oneof operation
4 insert google.datastore.v1.Entity

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

5 update google.datastore.v1.Entity

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

6 upsert google.datastore.v1.Entity

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

7 delete google.datastore.v1.Key

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.

message MutationResult google/datastore/v1/datastore.proto

The result of applying a mutation.

Field Type Description
3 key google.datastore.v1.Key

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

4 version int64

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.

5 conflict_detected bool

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

6 update_time google.protobuf.Timestamp

The update time of the entity on the server after processing the mutation. If the mutation doesn't change anything on the server, then the timestamp will be the update timestamp of the current entity. This field will not be set after a 'delete'.

7 create_time google.protobuf.Timestamp

The create time of the entity. This field will not be set after a 'delete'.

message PartitionId google/datastore/v1/entity.proto

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.

Field Type Description
2 project_id string

The ID of the project to which the entities belong.

3 database_id string

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

4 namespace_id string

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

message PathElement (Nested in google.datastore.v1.Key ) google/datastore/v1/entity.proto

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.

Field Type Description
1 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 "".

Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are encoded as __bytes<X>__ where <X> is the base-64 encoding of the bytes.

oneof id_type
2 id int64

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.

3 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 "".

Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are encoded as __bytes<X>__ where <X> is the base-64 encoding of the bytes.

message Projection google/datastore/v1/query.proto

A representation of a property in a projection.

Field Type Description
1 property google.datastore.v1.PropertyReference

The property to project.

message PropertyFilter google/datastore/v1/query.proto

A filter on a specific property.

Field Type Description
1 property google.datastore.v1.PropertyReference

The property to filter by.

2 op google.datastore.v1.PropertyFilter.Operator

The operator to filter by.

3 value google.datastore.v1.Value

The value to compare the property to.

message PropertyOrder google/datastore/v1/query.proto

The desired order for a specific property.

Field Type Description
1 property google.datastore.v1.PropertyReference

The property to order by.

2 direction google.datastore.v1.PropertyOrder.Direction

The direction to order by. Defaults to ASCENDING.

message PropertyReference google/datastore/v1/query.proto

A reference to a property relative to the kind expressions.

Field Type Description
2 name string

A reference to a property.

Requires:

  • MUST be a dot-delimited (.) string of segments, where each segment conforms to [entity property name][google.datastore.v1.Entity.properties] limitations.

message Query google/datastore/v1/query.proto

A query for entities.

Field Type Description
2 projection repeated google.datastore.v1.Projection

The projection to return. Defaults to returning all properties.

3 kind repeated google.datastore.v1.KindExpression

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

4 filter google.datastore.v1.Filter

The filter to apply.

5 order repeated google.datastore.v1.PropertyOrder

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

6 distinct_on repeated google.datastore.v1.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 in order.
7 start_cursor bytes

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.

8 end_cursor bytes

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.

10 offset int32

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

12 limit google.protobuf.Int32Value

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

message QueryResultBatch google/datastore/v1/query.proto

A batch of results produced by a query.

Field Type Description
1 entity_result_type google.datastore.v1.EntityResult.ResultType

The result type for every entity in entity_results.

2 entity_results repeated google.datastore.v1.EntityResult

The results for this batch.

3 skipped_cursor bytes

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

4 end_cursor bytes

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

5 more_results google.datastore.v1.QueryResultBatch.MoreResultsType

The state of the query after the current batch.

6 skipped_results int32

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

7 snapshot_version int64

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.

8 read_time google.protobuf.Timestamp

Read timestamp 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 timestamp. Each batch's read timestamp is valid for all preceding batches. This value will not be set for eventually consistent queries in Cloud Datastore.

message ReadOnly (Nested in google.datastore.v1.TransactionOptions ) google/datastore/v1/datastore.proto

Options specific to read-only transactions.

Field Type Description
1 read_time google.protobuf.Timestamp

Reads entities at the given time.

This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days.

message ReadOptions google/datastore/v1/datastore.proto

The options shared by read requests.

Field Type Description
oneof consistency_type
1 read_consistency google.datastore.v1.ReadOptions.ReadConsistency

The non-transactional read consistency to use.

2 transaction bytes

The identifier of the transaction in which to read. A transaction identifier is returned by a call to [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction].

3 new_transaction google.datastore.v1.TransactionOptions

Options for beginning a new transaction for this request.

The new transaction identifier will be returned in the corresponding response as either [LookupResponse.transaction][google.datastore.v1.LookupResponse.transaction] or [RunQueryResponse.transaction][google.datastore.v1.RunQueryResponse.transaction].

4 read_time google.protobuf.Timestamp

Reads entities as they were at the given time. This value is only supported for Cloud Firestore in Datastore mode.

This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days.

message ReadWrite (Nested in google.datastore.v1.TransactionOptions ) google/datastore/v1/datastore.proto

Options specific to read / write transactions.

Field Type Description
1 previous_transaction bytes

The transaction identifier of the transaction being retried.

message ReserveIdsRequest google/datastore/v1/datastore.proto

The request for [Datastore.ReserveIds][google.datastore.v1.Datastore.ReserveIds].

Field Type Description
1 keys repeated google.datastore.v1.Key

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

8 project_id string

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

9 database_id string

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

'(default)' is not allowed; please use empty string '' to refer the default database.

message ReserveIdsResponse google/datastore/v1/datastore.proto

The response for [Datastore.ReserveIds][google.datastore.v1.Datastore.ReserveIds].

Field Type Description

message RollbackRequest google/datastore/v1/datastore.proto

The request for [Datastore.Rollback][google.datastore.v1.Datastore.Rollback].

Field Type Description
1 transaction bytes

Required. The transaction identifier, returned by a call to [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction].

8 project_id string

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

9 database_id string

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

'(default)' is not allowed; please use empty string '' to refer the default database.

message RollbackResponse google/datastore/v1/datastore.proto

The response for [Datastore.Rollback][google.datastore.v1.Datastore.Rollback]. (an empty message).

Field Type Description

message RunAggregationQueryRequest google/datastore/v1/datastore.proto

The request for [Datastore.RunAggregationQuery][google.datastore.v1.Datastore.RunAggregationQuery].

Field Type Description
1 read_options google.datastore.v1.ReadOptions

The options for this query.

2 partition_id google.datastore.v1.PartitionId

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.

8 project_id string

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

9 database_id string

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

'(default)' is not allowed; please use empty string '' to refer the default database.

oneof query_type
3 aggregation_query google.datastore.v1.AggregationQuery

The query to run.

7 gql_query google.datastore.v1.GqlQuery

The GQL query to run. This query must be an aggregation query.

message RunAggregationQueryResponse google/datastore/v1/datastore.proto

The response for [Datastore.RunAggregationQuery][google.datastore.v1.Datastore.RunAggregationQuery].

Field Type Description
1 batch google.datastore.v1.AggregationResultBatch

A batch of aggregation results. Always present.

2 query google.datastore.v1.AggregationQuery

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

5 transaction bytes

The identifier of the transaction that was started as part of this RunAggregationQuery request.

Set only when [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] was set in [RunAggregationQueryRequest.read_options][google.datastore.v1.RunAggregationQueryRequest.read_options].

message RunQueryRequest google/datastore/v1/datastore.proto

The request for [Datastore.RunQuery][google.datastore.v1.Datastore.RunQuery].

Field Type Description
1 read_options google.datastore.v1.ReadOptions

The options for this query.

2 partition_id google.datastore.v1.PartitionId

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.

8 project_id string

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

9 database_id string

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

'(default)' is not allowed; please use empty string '' to refer the default database.

oneof query_type
3 query google.datastore.v1.Query

The query to run.

7 gql_query google.datastore.v1.GqlQuery

The GQL query to run. This query must be a non-aggregation query.

message RunQueryResponse google/datastore/v1/datastore.proto

The response for [Datastore.RunQuery][google.datastore.v1.Datastore.RunQuery].

Field Type Description
1 batch google.datastore.v1.QueryResultBatch

A batch of query results (always present).

2 query google.datastore.v1.Query

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

5 transaction bytes

The identifier of the transaction that was started as part of this RunQuery request.

Set only when [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] was set in [RunQueryRequest.read_options][google.datastore.v1.RunQueryRequest.read_options].

message Sum (Nested in google.datastore.v1.AggregationQuery.Aggregation ) google/datastore/v1/query.proto

Sum of the values of the requested property.

  • Only numeric values will be aggregated. All non-numeric values including NULL are skipped.

  • If the aggregated values contain NaN, returns NaN. Infinity math follows IEEE-754 standards.

  • If the aggregated value set is empty, returns 0.

  • Returns a 64-bit integer if all aggregated numbers are integers and the sum result does not overflow. Otherwise, the result is returned as a double. Note that even if all the aggregated values are integers, the result is returned as a double if it cannot fit within a 64-bit signed integer. When this occurs, the returned value will lose precision.

  • When underflow occurs, floating-point aggregation is non-deterministic. This means that running the same query repeatedly without any changes to the underlying values could produce slightly different results each time. In those cases, values should be stored as integers over floating-point numbers.

Field Type Description
1 property google.datastore.v1.PropertyReference

The property to aggregate on.

message TransactionOptions google/datastore/v1/datastore.proto

Options for beginning a new transaction.

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

Field Type Description
oneof mode
1 read_write google.datastore.v1.TransactionOptions.ReadWrite

The transaction should allow both reads and writes.

2 read_only google.datastore.v1.TransactionOptions.ReadOnly

The transaction should only allow reads.

message Value google/datastore/v1/entity.proto

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

Field Type Description
14 meaning int32

The meaning field should only be populated for backwards compatibility.

19 exclude_from_indexes bool

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

oneof value_type
1 boolean_value bool

A boolean value.

2 integer_value int64

An integer value.

3 double_value double

A double value.

5 key_value google.datastore.v1.Key

A key value.

6 entity_value google.datastore.v1.Entity

An entity value.

  • May have no key.
  • May have a key with an incomplete key path.
  • May have a reserved/read-only key.
8 geo_point_value google.type.LatLng

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

9 array_value google.datastore.v1.ArrayValue

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.

10 timestamp_value google.protobuf.Timestamp

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

11 null_value google.protobuf.NullValue

A null value.

17 string_value 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 most 1,000,000 bytes.

18 blob_value bytes

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.

Enums

enum Direction google/datastore/v1/query.proto

The sort direction.

Name Number Description
DIRECTION_UNSPECIFIED 0

Unspecified. This value must not be used.

ASCENDING 1

Ascending.

DESCENDING 2

Descending.

enum Mode google/datastore/v1/datastore.proto

The modes available for commits.

Name Number Description
MODE_UNSPECIFIED 0

Unspecified. This value must not be used.

TRANSACTIONAL 1

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

NON_TRANSACTIONAL 2

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

enum MoreResultsType google/datastore/v1/query.proto

The possible values for the more_results field.

Name Number Description
MORE_RESULTS_TYPE_UNSPECIFIED 0

Unspecified. This value is never used.

NOT_FINISHED 1

There may be additional batches to fetch from this query.

MORE_RESULTS_AFTER_LIMIT 2

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

MORE_RESULTS_AFTER_CURSOR 4

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

NO_MORE_RESULTS 3

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

enum Operator google/datastore/v1/query.proto

A composite filter operator.

Name Number Description
OPERATOR_UNSPECIFIED 0

Unspecified. This value must not be used.

AND 1

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

OR 2

Documents are required to satisfy at least one of the combined filters.

enum Operator google/datastore/v1/query.proto

A property filter operator.

Name Number Description
OPERATOR_UNSPECIFIED 0

Unspecified. This value must not be used.

LESS_THAN 1

The given property is less than the given value.

Requires:

  • That property comes first in order_by.
LESS_THAN_OR_EQUAL 2

The given property is less than or equal to the given value.

Requires:

  • That property comes first in order_by.
GREATER_THAN 3

The given property is greater than the given value.

Requires:

  • That property comes first in order_by.
GREATER_THAN_OR_EQUAL 4

The given property is greater than or equal to the given value.

Requires:

  • That property comes first in order_by.
EQUAL 5

The given property is equal to the given value.

IN 6

The given property is equal to at least one value in the given array.

Requires:

  • That value is a non-empty ArrayValue, subject to disjunction limits.
  • No NOT_IN is in the same query.
NOT_EQUAL 9

The given property is not equal to the given value.

Requires:

  • No other NOT_EQUAL or NOT_IN is in the same query.
  • That property comes first in the order_by.
HAS_ANCESTOR 11

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 13

The value of the property is not in the given array.

Requires:

  • That value is a non-empty ArrayValue with at most 10 values.
  • No other OR, IN, NOT_IN, NOT_EQUAL is in the same query.
  • That field comes first in the order_by.

enum ReadConsistency google/datastore/v1/datastore.proto

The possible values for read consistencies.

Name Number Description
READ_CONSISTENCY_UNSPECIFIED 0

Unspecified. This value must not be used.

STRONG 1

Strong consistency.

EVENTUAL 2

Eventual consistency.

enum ResultType google/datastore/v1/query.proto

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

Name Number Description
RESULT_TYPE_UNSPECIFIED 0

Unspecified. This value is never used.

FULL 1

The key and properties.

PROJECTION 2

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

KEY_ONLY 3

Only the key.