Cloud Firestore V1beta1 Client - Class UpdateDocumentRequest (1.47.1)

Reference documentation and code samples for the Cloud Firestore V1beta1 Client class UpdateDocumentRequest.

The request for Firestore.UpdateDocument.

Generated from protobuf message google.firestore.v1beta1.UpdateDocumentRequest

Namespace

Google \ Cloud \ Firestore \ V1beta1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ document Document

Required. The updated document. Creates the document if it does not already exist.

↳ update_mask 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.

↳ mask 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.

↳ current_document Precondition

An optional precondition on the document. The request will fail if this is set and not met by the target document.

getDocument

Required. The updated document.

Creates the document if it does not already exist.

Returns
Type Description
Document

setDocument

Required. The updated document.

Creates the document if it does not already exist.

Parameter
Name Description
var Document
Returns
Type Description
$this

getUpdateMask

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
Type Description
DocumentMask

setUpdateMask

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.

Parameter
Name Description
var DocumentMask
Returns
Type Description
$this

getMask

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
Type Description
DocumentMask

setMask

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.

Parameter
Name Description
var DocumentMask
Returns
Type Description
$this

getCurrentDocument

An optional precondition on the document.

The request will fail if this is set and not met by the target document.

Returns
Type Description
Precondition

setCurrentDocument

An optional precondition on the document.

The request will fail if this is set and not met by the target document.

Parameter
Name Description
var Precondition
Returns
Type Description
$this