IDocumentClient.CreateDocumentAsync
Method
Definition
Overloads
| CreateDocumentAsync(String, Object, RequestOptions, Boolean) |
Creates a Document as an asychronous operation in the Azure DocumentDB database service. |
| CreateDocumentAsync(Uri, Object, RequestOptions, Boolean) |
Creates a document as an asychronous operation in the Azure DocumentDB database service. |
CreateDocumentAsync(String, Object, RequestOptions, Boolean)
Creates a Document as an asychronous operation in the Azure DocumentDB database service.
public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Document>> CreateDocumentAsync (string collectionLink, object document, Microsoft.Azure.Documents.Client.RequestOptions options = null, bool disableAutomaticIdGeneration = false);
- collectionLink
- String
The link of the DocumentCollection to create the document in. E.g. dbs/db_rid/colls/coll_rid/
- document
- Object
The document object to create.
- options
- RequestOptions
(Optional) The request options you wish to set. E.g. Specifying a Trigger to execute when creating the document. RequestOptions
- disableAutomaticIdGeneration
- Boolean
(Optional) Disables the automatic id generation, If this is True the system will throw an exception if the id property is missing from the Document.
CreateDocumentAsync(Uri, Object, RequestOptions, Boolean)
Creates a document as an asychronous operation in the Azure DocumentDB database service.
public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Document>> CreateDocumentAsync (Uri documentCollectionUri, object document, Microsoft.Azure.Documents.Client.RequestOptions options = null, bool disableAutomaticIdGeneration = false);
- documentCollectionUri
- Uri
The URI of the document collection to create the document in.
- document
- Object
The document object.
- options
- RequestOptions
(Optional) The RequestOptions for the request.
- disableAutomaticIdGeneration
- Boolean
A flag to disable automatic id generation.
The task object representing the service response for the asynchronous operation.