Share via


ChangeFeedDocumentClient.CreateDocumentAsync Method

Definition

Creates the document.

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.IResourceResponse<Microsoft.Azure.Documents.Document>> CreateDocumentAsync (string documentsFeedOrDatabaseLink, object document, Microsoft.Azure.Documents.Client.RequestOptions options = default, bool disableAutomaticIdGeneration = false, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateDocumentAsync : string * obj * Microsoft.Azure.Documents.Client.RequestOptions * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.IResourceResponse<Microsoft.Azure.Documents.Document>>
override this.CreateDocumentAsync : string * obj * Microsoft.Azure.Documents.Client.RequestOptions * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.IResourceResponse<Microsoft.Azure.Documents.Document>>
Public Function CreateDocumentAsync (documentsFeedOrDatabaseLink As String, document As Object, Optional options As RequestOptions = Nothing, Optional disableAutomaticIdGeneration As Boolean = false, Optional cancellationToken As CancellationToken = Nothing) As Task(Of IResourceResponse(Of Document))

Parameters

documentsFeedOrDatabaseLink
String

Collection Self Link.

document
Object

Document to store.

options
RequestOptions

The RequestOptionsfor this request.

disableAutomaticIdGeneration
Boolean

Disables the automatic id generation, If this is True the system will throw an exception if the id property is missing from the Document.

cancellationToken
CancellationToken

A CancellationTokenthat can be used by other objects or threads to receive notice of cancellation.

Returns

A response containing a Document.

Implements

Applies to