Cloud Firestore V1 Client - Class CreateDocumentRequest (1.37.7)

Reference documentation and code samples for the Cloud Firestore V1 Client class CreateDocumentRequest.

The request for Firestore.CreateDocument.

Generated from protobuf message google.firestore.v1.CreateDocumentRequest

Namespace

Google \ Cloud \ Firestore \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ parent string

Required. The parent resource. For example: projects/{project_id}/databases/{database_id}/documents or projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}

↳ collection_id string

Required. The collection ID, relative to parent, to list. For example: chatrooms.

↳ document_id string

The client-assigned document ID to use for this document. Optional. If not specified, an ID will be assigned by the service.

↳ document Google\Cloud\Firestore\V1\Document

Required. The document to create. name must not be set.

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

getParent

Required. The parent resource. For example: projects/{project_id}/databases/{database_id}/documents or projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}

Returns
TypeDescription
string

setParent

Required. The parent resource. For example: projects/{project_id}/databases/{database_id}/documents or projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getCollectionId

Required. The collection ID, relative to parent, to list. For example: chatrooms.

Returns
TypeDescription
string

setCollectionId

Required. The collection ID, relative to parent, to list. For example: chatrooms.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDocumentId

The client-assigned document ID to use for this document.

Optional. If not specified, an ID will be assigned by the service.

Returns
TypeDescription
string

setDocumentId

The client-assigned document ID to use for this document.

Optional. If not specified, an ID will be assigned by the service.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDocument

Required. The document to create. name must not be set.

Returns
TypeDescription
Google\Cloud\Firestore\V1\Document|null

hasDocument

clearDocument

setDocument

Required. The document to create. name must not be set.

Parameter
NameDescription
var Google\Cloud\Firestore\V1\Document
Returns
TypeDescription
$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
TypeDescription
Google\Cloud\Firestore\V1\DocumentMask|null

hasMask

clearMask

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
NameDescription
var Google\Cloud\Firestore\V1\DocumentMask
Returns
TypeDescription
$this