public sealed class UpdateDocumentRequest : IMessage<UpdateDocumentRequest>, IEquatable<UpdateDocumentRequest>, IDeepCloneable<UpdateDocumentRequest>, IBufferMessage, IMessage
Reference documentation and code samples for the Firestore v1 API class UpdateDocumentRequest.
The request for
[Firestore.UpdateDocument][google.firestore.v1.Firestore.UpdateDocument].
The fields to update.
None of the field paths in the mask may contain a reserved name.
If the document exists on the server and has fields not referenced in the
mask, they are left unchanged.
Fields referenced in the mask, but not present in the input document, are
deleted from the document on the server.
[[["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 \u003ccode\u003eUpdateDocumentRequest\u003c/code\u003e class is part of the Firestore v1 API and is used to request document updates within Firestore.\u003c/p\u003e\n"],["\u003cp\u003eThis class implements interfaces such as \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, supporting various functionalities like message handling, equality checks, deep cloning, and buffered message operations.\u003c/p\u003e\n"],["\u003cp\u003eThe class allows specifying an optional \u003ccode\u003eCurrentDocument\u003c/code\u003e precondition, enabling conditional updates based on the document's state.\u003c/p\u003e\n"],["\u003cp\u003eIt requires a \u003ccode\u003eDocument\u003c/code\u003e property, representing the updated document content which is created if the document does not exist, and a \u003ccode\u003eUpdateMask\u003c/code\u003e to specify which fields to update.\u003c/p\u003e\n"],["\u003cp\u003eThe available versions of the API are ranging from version 2.3.0 up to the latest version 3.10.0.\u003c/p\u003e\n"]]],[],null,["# Firestore v1 API - Class UpdateDocumentRequest (3.10.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.10.0 (latest)](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.UpdateDocumentRequest)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.9.0/Google.Cloud.Firestore.V1.UpdateDocumentRequest)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.8.0/Google.Cloud.Firestore.V1.UpdateDocumentRequest)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.7.0/Google.Cloud.Firestore.V1.UpdateDocumentRequest)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.6.0/Google.Cloud.Firestore.V1.UpdateDocumentRequest)\n- [3.5.1](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.5.1/Google.Cloud.Firestore.V1.UpdateDocumentRequest)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.4.0/Google.Cloud.Firestore.V1.UpdateDocumentRequest)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.3.0/Google.Cloud.Firestore.V1.UpdateDocumentRequest)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.2.0/Google.Cloud.Firestore.V1.UpdateDocumentRequest)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.1.0/Google.Cloud.Firestore.V1.UpdateDocumentRequest)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.0.0/Google.Cloud.Firestore.V1.UpdateDocumentRequest)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/2.5.0/Google.Cloud.Firestore.V1.UpdateDocumentRequest)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/2.4.0/Google.Cloud.Firestore.V1.UpdateDocumentRequest)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/2.3.0/Google.Cloud.Firestore.V1.UpdateDocumentRequest) \n\n public sealed class UpdateDocumentRequest : IMessage\u003cUpdateDocumentRequest\u003e, IEquatable\u003cUpdateDocumentRequest\u003e, IDeepCloneable\u003cUpdateDocumentRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Firestore v1 API class UpdateDocumentRequest.\n\nThe request for\n\\[Firestore.UpdateDocument\\]\\[google.firestore.v1.Firestore.UpdateDocument\\]. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e UpdateDocumentRequest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[UpdateDocumentRequest](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.UpdateDocumentRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[UpdateDocumentRequest](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.UpdateDocumentRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[UpdateDocumentRequest](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.UpdateDocumentRequest), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \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.V1](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Firestore.V1.dll\n\nConstructors\n------------\n\n### UpdateDocumentRequest()\n\n public UpdateDocumentRequest()\n\n### UpdateDocumentRequest(UpdateDocumentRequest)\n\n public UpdateDocumentRequest(UpdateDocumentRequest other)\n\nProperties\n----------\n\n### CurrentDocument\n\n public Precondition CurrentDocument { get; set; }\n\nAn optional precondition on the document.\nThe request will fail if this is set and not met by the target document.\n\n### Document\n\n public Document Document { get; set; }\n\nRequired. The updated document.\nCreates the document if it does not already exist.\n\n### Mask\n\n public DocumentMask Mask { get; set; }\n\nThe fields to return. If not set, returns all fields.\n\nIf the document has a field that is not present in this mask, that field\nwill not be returned in the response.\n\n### UpdateMask\n\n public DocumentMask UpdateMask { get; set; }\n\nThe fields to update.\nNone of the field paths in the mask may contain a reserved name.\n\nIf the document exists on the server and has fields not referenced in the\nmask, they are left unchanged.\nFields referenced in the mask, but not present in the input document, are\ndeleted from the document on the server."]]