Stay organized with collections Save and categorize content based on your preferences.
Applies a batch of write operations.
The documents.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 documents.commit instead.
HTTP request
POST https://firestore.googleapis.com/v1/{database=projects/*/databases/*}/documents:batchWrite
Method does not apply writes atomically and does not guarantee ordering. Each write succeeds or fails independently. You cannot write to the same document more than once per request.
labels
map (key: string, value: string)
Labels associated with this batch write.
An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-02 UTC."],[[["This `batchWrite` method applies multiple write operations to Firestore documents, but not atomically or in a guaranteed order."],["Each individual write operation within a batch either succeeds or fails independently, and you can review their respective success status in the `BatchWriteResponse`."],["You cannot have more than one write operation per document in the same `batchWrite` request."],["To apply writes atomically, use the `documents.commit` method instead of `documents.batchWrite`."],["The request body requires an array of `writes`, an array of `Write` objects, and an optional set of `labels`, while the response body returns an array of `writeResults` and `status`, all objects that will have a direct link to the array of `writes`."]]],[]]