# Cloud Firestore V1 API - Class Google::Cloud::Firestore::V1::UpdateDocumentRequest (v2.4.0)

2.4.0 (latest) 2.3.0 2.2.1 2.1.1 2.0.1 1.3.0 1.2.0 1.1.1 1.0.0 0.14.0 0.13.0 0.12.0 0.11.1 0.10.0 0.9.0 0.8.0 0.7.1 0.6.0 0.5.0 0.4.8 Reference documentation and code samples for the Cloud Firestore V1 API class Google::Cloud::Firestore::V1::UpdateDocumentRequest.

The request for
[Firestore.UpdateDocument](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Firestore-Client#Google__Cloud__Firestore__V1__Firestore__Client_update_document_instance_ "Google::Cloud::Firestore::V1::Firestore::Client#update_document (method)").

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #current_document

    def current_document() -> ::Google::Cloud::Firestore::V1::Precondition

**Returns**

- ([::Google::Cloud::Firestore::V1::Precondition](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Precondition)) --- An optional precondition on the document. The request will fail if this is set and not met by the target document.

### #current_document=

    def current_document=(value) -> ::Google::Cloud::Firestore::V1::Precondition

**Parameter**

- **value** ([::Google::Cloud::Firestore::V1::Precondition](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Precondition)) --- An optional precondition on the document. The request will fail if this is set and not met by the target document.
**Returns**

- ([::Google::Cloud::Firestore::V1::Precondition](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Precondition)) --- An optional precondition on the document. The request will fail if this is set and not met by the target document.

### #document

    def document() -> ::Google::Cloud::Firestore::V1::Document

**Returns**

- ([::Google::Cloud::Firestore::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document)) --- Required. The updated document. Creates the document if it does not already exist.

### #document=

    def document=(value) -> ::Google::Cloud::Firestore::V1::Document

**Parameter**

- **value** ([::Google::Cloud::Firestore::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document)) --- Required. The updated document. Creates the document if it does not already exist.
**Returns**

- ([::Google::Cloud::Firestore::V1::Document](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-Document)) --- Required. The updated document. Creates the document if it does not already exist.

### #mask

    def mask() -> ::Google::Cloud::Firestore::V1::DocumentMask

**Returns**

- ([::Google::Cloud::Firestore::V1::DocumentMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentMask)) --- The fields to return. If not set, returns all fields.


  If the document has a field that is not present in this mask, that field
  will not be returned in the response.

### #mask=

    def mask=(value) -> ::Google::Cloud::Firestore::V1::DocumentMask

**Parameter**

- **value** ([::Google::Cloud::Firestore::V1::DocumentMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentMask)) --- The fields to return. If not set, returns all fields.


  If the document has a field that is not present in this mask, that field
  will not be returned in the response.
**Returns**

- ([::Google::Cloud::Firestore::V1::DocumentMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentMask)) --- The fields to return. If not set, returns all fields.


  If the document has a field that is not present in this mask, that field
  will not be returned in the response.

### #update_mask

    def update_mask() -> ::Google::Cloud::Firestore::V1::DocumentMask

**Returns**

- ([::Google::Cloud::Firestore::V1::DocumentMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentMask)) --- 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.

### #update_mask=

    def update_mask=(value) -> ::Google::Cloud::Firestore::V1::DocumentMask

**Parameter**

- **value** ([::Google::Cloud::Firestore::V1::DocumentMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentMask)) --- 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.
**Returns**

- ([::Google::Cloud::Firestore::V1::DocumentMask](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-firestore-v1/latest/Google-Cloud-Firestore-V1-DocumentMask)) --- 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.