Menu
Firestore.projects.databases.documents.batch Write
Applies a batch of write operations. The BatchWrite method does not apply the write operations atomically and can apply them out of order. Method does not allow more than one write per document. Each write succeeds or fails independently. See the BatchWriteResponse for the success status of each write. If you require an atomically applied set of writes, use Commit instead.
POST
/v1/{database}/documents:batchWriteUse it in a workflow
- Add a step and choose the Firestore connector.
- Pick the Firestore.projects.databases.documents.batch Write action (under projects).
- Fill in the fields below, then reference the result from later steps as
{{firestoreProjectsDatabasesDocumentsBatchWrite.response.data}}.
Request
Path parameters
Query parameters
Request body
Enter the body as JSON in the step's Body field.
{
"labels": {},
"writes": [
{
"currentDocument": {
"exists": false,
"updateTime": "string"
},
"delete": "string",
"transform": {
"document": "string",
"fieldTransforms": [
{
"appendMissingElements": {
"values": null
},
"fieldPath": "string",
"increment": {
"arrayValue": null,
"booleanValue": null,
"bytesValue": null,
"doubleValue": null,
"geoPointValue": null,
"integerValue": null,
"mapValue": null,
"nullValue": null,
"referenceValue": null,
"stringValue": null,
"timestampValue": null
},
"maximum": {
"arrayValue": null,
"booleanValue": null,
"bytesValue": null,
"doubleValue": null,
"geoPointValue": null,
"integerValue": null,
"mapValue": null,
"nullValue": null,
"referenceValue": null,
"stringValue": null,
"timestampValue": null
},
"minimum": {
"arrayValue": null,
"booleanValue": null,
"bytesValue": null,
"doubleValue": null,
"geoPointValue": null,
"integerValue": null,
"mapValue": null,
"nullValue": null,
"referenceValue": null,
"stringValue": null,
"timestampValue": null
},
"removeAllFromArray": {
"values": null
},
"setToServerValue": "SERVER_VALUE_UNSPECIFIED"
}
]
},
"update": {
"createTime": "string",
"fields": {},
"name": "string",
"updateTime": "string"
},
"updateMask": {
"fieldPaths": [
"string"
]
},
"updateTransforms": [
{
"appendMissingElements": {
"values": [
null
]
},
"fieldPath": "string",
"increment": {
"arrayValue": {
"values": null
},
"booleanValue": false,
"bytesValue": "string",
"doubleValue": 0,
"geoPointValue": {
"latitude": null,
"longitude": null
},
"integerValue": "string",
"mapValue": {
"fields": null
},
"nullValue": "NULL_VALUE",
"referenceValue": "string",
"stringValue": "string",
"timestampValue": "string"
},
"maximum": {
"arrayValue": {
"values": null
},
"booleanValue": false,
"bytesValue": "string",
"doubleValue": 0,
"geoPointValue": {
"latitude": null,
"longitude": null
},
"integerValue": "string",
"mapValue": {
"fields": null
},
"nullValue": "NULL_VALUE",
"referenceValue": "string",
"stringValue": "string",
"timestampValue": "string"
},
"minimum": {
"arrayValue": {
"values": null
},
"booleanValue": false,
"bytesValue": "string",
"doubleValue": 0,
"geoPointValue": {
"latitude": null,
"longitude": null
},
"integerValue": "string",
"mapValue": {
"fields": null
},
"nullValue": "NULL_VALUE",
"referenceValue": "string",
"stringValue": "string",
"timestampValue": "string"
},
"removeAllFromArray": {
"values": [
null
]
},
"setToServerValue": "SERVER_VALUE_UNSPECIFIED"
}
]
}
]
}
Response
Returns 200 with an object. Read it in later steps with {{firestoreProjectsDatabasesDocumentsBatchWrite.response.data.<field>}}.
{
"status": [
{
"code": 0,
"details": [
{}
],
"message": "string"
}
],
"writeResults": [
{
"transformResults": [
{
"arrayValue": {
"values": [
null
]
},
"booleanValue": false,
"bytesValue": "string",
"doubleValue": 0,
"geoPointValue": {
"latitude": 0,
"longitude": 0
},
"integerValue": "string",
"mapValue": {
"fields": {}
},
"nullValue": "NULL_VALUE",
"referenceValue": "string",
"stringValue": "string",
"timestampValue": "string"
}
],
"updateTime": "string"
}
]
}
Need more? See the Firestore guide for connection setup and behaviour shared by every action.
Was this page helpful?