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."],[[["\u003cp\u003eThis \u003ccode\u003ebatchWrite\u003c/code\u003e method applies multiple write operations to Firestore documents, but not atomically or in a guaranteed order.\u003c/p\u003e\n"],["\u003cp\u003eEach individual write operation within a batch either succeeds or fails independently, and you can review their respective success status in the \u003ccode\u003eBatchWriteResponse\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou cannot have more than one write operation per document in the same \u003ccode\u003ebatchWrite\u003c/code\u003e request.\u003c/p\u003e\n"],["\u003cp\u003eTo apply writes atomically, use the \u003ccode\u003edocuments.commit\u003c/code\u003e method instead of \u003ccode\u003edocuments.batchWrite\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires an array of \u003ccode\u003ewrites\u003c/code\u003e, an array of \u003ccode\u003eWrite\u003c/code\u003e objects, and an optional set of \u003ccode\u003elabels\u003c/code\u003e, while the response body returns an array of \u003ccode\u003ewriteResults\u003c/code\u003e and \u003ccode\u003estatus\u003c/code\u003e, all objects that will have a direct link to the array of \u003ccode\u003ewrites\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]