Reference documentation and code samples for the Cloud Firestore V1beta1 Client class CreateDocumentRequest.
The request for Firestore.CreateDocument.
Generated from protobuf message google.firestore.v1beta1.CreateDocumentRequest
Namespace
Google \ Cloud \ Firestore \ V1beta1Methods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ parent |
string
Required. The parent resource. For example: |
↳ collection_id |
string
Required. The collection ID, relative to |
↳ 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 |
Document
Required. The document to create. |
↳ 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. |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getCollectionId
Required. The collection ID, relative to parent
, to list. For example: chatrooms
.
Returns | |
---|---|
Type | Description |
string |
setCollectionId
Required. The collection ID, relative to parent
, to list. For example: chatrooms
.
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getDocument
Required. The document to create. name
must not be set.
Returns | |
---|---|
Type | Description |
Document |
setDocument
Required. The document to create. name
must not be set.
Parameter | |
---|---|
Name | Description |
var |
Document
|
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 |