Ir a la consola

Package google.firestore.v1beta1

Index

Firestore

The Cloud Firestore service.

This service exposes several types of comparable timestamps:

  • create_time - The time at which a document was created. Changes only when a document is deleted, then re-created. Increases in a strict monotonic fashion.
  • update_time - The time at which a document was last updated. Changes every time a document is modified. Does not change when a write results in no modifications. Increases in a strict monotonic fashion.
  • read_time - The time at which a particular state was observed. Used to denote a consistent snapshot of the database or the time at which a Document was observed to not exist.
  • commit_time - The time at which the writes in a transaction were committed. Any read with an equal or greater read_time is guaranteed to see the effects of the transaction.
BatchGetDocuments

rpc BatchGetDocuments(BatchGetDocumentsRequest) returns (BatchGetDocumentsResponse)

Gets multiple documents.

Documents returned by this method are not guaranteed to be returned in the same order that they were requested.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/datastore
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

BeginTransaction

rpc BeginTransaction(BeginTransactionRequest) returns (BeginTransactionResponse)

Starts a new transaction.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/datastore
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

Commit

rpc Commit(CommitRequest) returns (CommitResponse)

Commits a transaction, while optionally updating documents.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/datastore
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

CreateDocument

rpc CreateDocument(CreateDocumentRequest) returns (Document)

Creates a new document.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/datastore
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteDocument

rpc DeleteDocument(DeleteDocumentRequest) returns (Empty)

Deletes a document.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/datastore
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetDocument

rpc GetDocument(GetDocumentRequest) returns (Document)

Gets a single document.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/datastore
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListCollectionIds

rpc ListCollectionIds(ListCollectionIdsRequest) returns (ListCollectionIdsResponse)

Lists all the collection IDs underneath a document.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/datastore
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListDocuments

rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse)

Lists documents.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/datastore
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

Listen

rpc Listen(ListenRequest) returns (ListenResponse)

Listens to changes.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/datastore
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

Rollback

rpc Rollback(RollbackRequest) returns (Empty)

Rolls back a transaction.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/datastore
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

RunQuery

rpc RunQuery(RunQueryRequest) returns (RunQueryResponse)

Runs a query.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/datastore
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateDocument

rpc UpdateDocument(UpdateDocumentRequest) returns (Document)

Updates or inserts a document.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/datastore
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

Write

rpc Write(WriteRequest) returns (WriteResponse)

Streams batches of document updates and deletes, in order.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/datastore
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ArrayValue

An array value.

Fields
values[]

Value

Values in the array.

BatchGetDocumentsRequest

The request for Firestore.BatchGetDocuments.

Fields
database

string

The database name. In the format: projects/{project_id}/databases/{database_id}.

documents[]

string

The names of the documents to retrieve. In the format: projects/{project_id}/databases/{database_id}/documents/{document_path}. The request will fail if any of the document is not a child resource of the given database. Duplicate names will be elided.

mask

DocumentMask

The fields to return. If not set, returns all fields.

If a document has a field that is not present in this mask, that field will not be returned in the response.

Union field consistency_selector. The consistency mode for this transaction. If not set, defaults to strong consistency. consistency_selector can be only one of the following:
transaction

bytes

Reads documents in a transaction.

new_transaction

TransactionOptions

Starts a new transaction and reads the documents. Defaults to a read-only transaction. The new transaction ID will be returned as the first response in the stream.

read_time

Timestamp

Reads documents as they were at the given time. This may not be older than 60 seconds.

BatchGetDocumentsResponse

The streamed response for Firestore.BatchGetDocuments.

Fields
transaction

bytes

The transaction that was started as part of this request. Will only be set in the first response, and only if BatchGetDocumentsRequest.new_transaction was set in the request.

read_time

Timestamp

The time at which the document was read. This may be monotically increasing, in this case the previous documents in the result stream are guaranteed not to have changed between their read_time and this one.

Union field result. A single result. This can be empty if the server is just returning a transaction. result can be only one of the following:
found

Document

A document that was requested.

missing

string

A document name that was requested but does not exist. In the format: projects/{project_id}/databases/{database_id}/documents/{document_path}.

BeginTransactionRequest

The request for Firestore.BeginTransaction.

Fields
database

string

The database name. In the format: projects/{project_id}/databases/{database_id}.

options

TransactionOptions

The options for the transaction. Defaults to a read-write transaction.

BeginTransactionResponse

The response for Firestore.BeginTransaction.

Fields
transaction

bytes

The transaction that was started.

CommitRequest

The request for Firestore.Commit.

Fields
database

string

The database name. In the format: projects/{project_id}/databases/{database_id}.

writes[]

Write

The writes to apply.

Always executed atomically and in order.

transaction

bytes

If set, applies all writes in this transaction, and commits it.

CommitResponse

The response for Firestore.Commit.

Fields
write_results[]

WriteResult

The result of applying the writes.

This i-th write result corresponds to the i-th write in the request.

commit_time

Timestamp

The time at which the commit occurred.

CreateDocumentRequest

The request for Firestore.CreateDocument.

Fields
parent

string

The parent resource. For example: projects/{project_id}/databases/{database_id}/documents or projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}

collection_id

string

The collection ID, relative to parent, to list. For example: chatrooms.

document_id

string

The client-assigned document ID to use for this document.

Optional. If not specified, an ID will be assigned by the service.

document

Document

The document to create. name must not be set.

mask

DocumentMask

The fields to return. If not set, returns all fields.

If the document has a field that is not present in this mask, that field will not be returned in the response.

Cursor

A position in a query result set.

Fields
values[]

Value

The values that represent a position, in the order they appear in the order by clause of a query.

Can contain fewer values than specified in the order by clause.

before

bool

If the position is just before or just after the given values, relative to the sort order defined by the query.

DeleteDocumentRequest

The request for Firestore.DeleteDocument.

Fields
name

string

The resource name of the Document to delete. In the format: projects/{project_id}/databases/{database_id}/documents/{document_path}.

current_document

Precondition

An optional precondition on the document. The request will fail if this is set and not met by the target document.

Document

A Firestore document.

Must not exceed 1 MiB - 4 bytes.

Fields
name

string

The resource name of the document, for example projects/{project_id}/databases/{database_id}/documents/{document_path}.

fields

map<string, Value>

The document's fields.

The map keys represent field names.

A simple field name contains only characters a to z, A to Z, 0 to 9, or _, and must not start with 0 to 9. For example, foo_bar_17.

Field names matching the regular expression __.*__ are reserved. Reserved field names are forbidden except in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.

Field paths may be used in other contexts to refer to structured fields defined here. For map_value, the field path is represented by the simple or quoted field names of the containing fields, delimited by .. For example, the structured field "foo" : { map_value: { "x&y" : { string_value: "hello" }}} would be represented by the field path foo.x&y.

Within a field path, a quoted field name starts and ends with ` and may contain any character. Some characters, including `, must be escaped using a \. For example, `x&y` represents x&y and