Go to console

Package google.firestore.v1

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