Streams batches of document updates and deletes, in order.
HTTP request
POST https://firestore.googleapis.com/v1beta1/{database=projects/*/databases/*}/documents:write
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
database |
Required. The database name. In the format: |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{
"streamId": string,
"writes": [
{
object ( |
Fields | |
---|---|
streamId |
The ID of the write stream to resume. This may only be set in the first message. When left empty, a new write stream will be created. |
writes[] |
The writes to apply. Always executed atomically and in order. This must be empty on the first request. This may be empty on the last request. This must not be empty on all other requests. |
streamToken |
A stream token that was previously sent by the server. The client should set this field to the token from the most recent The server may close the stream if there are too many unacknowledged responses. Leave this field unset when creating a new stream. To resume a stream at a specific point, set this field and the Leave this field unset when creating a new stream. A base64-encoded string. |
labels |
Labels associated with this write request. An object containing a list of |
Response body
If successful, the response body contains data with the following structure:
The response for Firestore.Write
.
JSON representation |
---|
{
"streamId": string,
"streamToken": string,
"writeResults": [
{
object ( |
Fields | |
---|---|
streamId |
The ID of the stream. Only set on the first message, when a new stream was created. |
streamToken |
A token that represents the position of this response in the stream. This can be used by a client to resume the stream at this point. This field is always set. A base64-encoded string. |
writeResults[] |
The result of applying the writes. This i-th write result corresponds to the i-th write in the request. |
commitTime |
The time at which the commit occurred. Any read with an equal or greater A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
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.