The updates to perform on the document, keyed by the field path to update. Fields not present in this dictionary are not updated. Must not be null or empty.
The updates to perform on the document, keyed by the dot-separated field path to update. Fields not present in this dictionary are not updated. Must not be null or empty.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eWriteBatch\u003c/code\u003e class in the Firestore API is 3.10.0, with documentation available for previous versions dating back to 2.3.1.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eWriteBatch\u003c/code\u003e is a class that allows for multiple write operations to be performed in a single commit, it inherits from object and has inherited members including \u003ccode\u003eGetHashCode()\u003c/code\u003e, \u003ccode\u003eGetType()\u003c/code\u003e, and \u003ccode\u003eToString()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCommitAsync\u003c/code\u003e method commits all operations in the batch to the server and returns the write results as a list of \u003ccode\u003eWriteResult\u003c/code\u003e objects, asynchronously.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eWriteBatch\u003c/code\u003e class supports various operations on documents, including \u003ccode\u003eCreate\u003c/code\u003e to add new documents, \u003ccode\u003eDelete\u003c/code\u003e to remove them, \u003ccode\u003eSet\u003c/code\u003e to replace or merge data, and \u003ccode\u003eUpdate\u003c/code\u003e to modify specific fields within a document.\u003c/p\u003e\n"],["\u003cp\u003eAll write operations in \u003ccode\u003eWriteBatch\u003c/code\u003e such as \u003ccode\u003eDelete\u003c/code\u003e and \u003ccode\u003eUpdate\u003c/code\u003e can include an optional \u003ccode\u003ePrecondition\u003c/code\u003e parameter to allow for conditional changes, and all of them return the WriteBatch, allowing for method chaining.\u003c/p\u003e\n"]]],[],null,["# Firestore API - Class WriteBatch (3.10.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.10.0 (latest)](/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore.WriteBatch)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.9.0/Google.Cloud.Firestore.WriteBatch)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.8.0/Google.Cloud.Firestore.WriteBatch)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.7.0/Google.Cloud.Firestore.WriteBatch)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.6.0/Google.Cloud.Firestore.WriteBatch)\n- [3.5.1](/dotnet/docs/reference/Google.Cloud.Firestore/3.5.1/Google.Cloud.Firestore.WriteBatch)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.4.0/Google.Cloud.Firestore.WriteBatch)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.3.0/Google.Cloud.Firestore.WriteBatch)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.2.0/Google.Cloud.Firestore.WriteBatch)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.1.0/Google.Cloud.Firestore.WriteBatch)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Firestore/3.0.0/Google.Cloud.Firestore.WriteBatch)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Firestore/2.5.0/Google.Cloud.Firestore.WriteBatch)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Firestore/2.4.0/Google.Cloud.Firestore.WriteBatch)\n- [2.3.1](/dotnet/docs/reference/Google.Cloud.Firestore/2.3.1/Google.Cloud.Firestore.WriteBatch) \n\n public sealed class WriteBatch\n\nReference documentation and code samples for the Firestore API class WriteBatch.\n\nA batch of write operations, to be applied in a single commit. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e WriteBatch \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Firestore](/dotnet/docs/reference/Google.Cloud.Firestore/latest/Google.Cloud.Firestore)\n\nAssembly\n--------\n\nGoogle.Cloud.Firestore.dll\n\nMethods\n-------\n\n### CommitAsync(CancellationToken)\n\n public Task\u003cIList\u003cWriteResult\u003e\u003e CommitAsync(CancellationToken cancellationToken = default)\n\nCommits the batch on the server.\n\n### Create(DocumentReference, object)\n\n public WriteBatch Create(DocumentReference documentReference, object documentData)\n\nAdds a write operation which will create the specified document with a precondition\nthat it doesn't exist already.\n\n### Delete(DocumentReference, Precondition)\n\n public WriteBatch Delete(DocumentReference documentReference, Precondition precondition = null)\n\nAdds a write operation that deletes the specified document, with an optional precondition.\n\n### Set(DocumentReference, object, SetOptions)\n\n public WriteBatch Set(DocumentReference documentReference, object documentData, SetOptions options = null)\n\nAdds an operation that sets data in a document, either replacing it completely or merging fields.\n\n### Update(DocumentReference, IDictionary\\\u003cFieldPath, object\\\u003e, Precondition)\n\n public WriteBatch Update(DocumentReference documentReference, IDictionary\u003cFieldPath, object\u003e updates, Precondition precondition = null)\n\nAdds an update operation that updates just the specified fields paths in the document, with the corresponding values.\n\n### Update(DocumentReference, IDictionary\\\u003cstring, object\\\u003e, Precondition)\n\n public WriteBatch Update(DocumentReference documentReference, IDictionary\u003cstring, object\u003e updates, Precondition precondition = null)\n\nAdds an update operation that updates just the specified fields paths in the document, with the corresponding values.\n\n### Update(DocumentReference, string, object, Precondition)\n\n public WriteBatch Update(DocumentReference documentReference, string field, object value, Precondition precondition = null)\n\nAdds an update operation that updates just the specified field in the document, with the corresponding values."]]