IDocumentClient.UpsertDocumentAsync Method

Definition

Overloads

UpsertDocumentAsync(Uri, Object, RequestOptions, Boolean)

Upserts a document as an asychronous operation in the Azure DocumentDB database service.

UpsertDocumentAsync(String, Object, RequestOptions, Boolean)

Upserts a Document as an asychronous operation in the Azure DocumentDB database service.

UpsertDocumentAsync(Uri, Object, RequestOptions, Boolean)

Upserts 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>> UpsertDocumentAsync (Uri documentCollectionUri, object document, Microsoft.Azure.Documents.Client.RequestOptions options = null, bool disableAutomaticIdGeneration = false);
Parameters
documentCollectionUri
Uri

The URI of the document collection to upsert the document in.

document
Object

The document object.

options
RequestOptions

(Optional) The RequestOptions for the request.

disableAutomaticIdGeneration
Boolean

A flag to disable the automatic id generation.

Returns

The task object representing the service response for the asynchronous operation.

UpsertDocumentAsync(String, Object, RequestOptions, Boolean)

Upserts 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>> UpsertDocumentAsync (string collectionLink, object document, Microsoft.Azure.Documents.Client.RequestOptions options = null, bool disableAutomaticIdGeneration = false);
Parameters
collectionLink
String

The link of the DocumentCollection to upsert the document in. E.g. dbs/db_rid/colls/coll_rid/

document
Object

The document object to upsert.

options
RequestOptions

(Optional) Any 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.

Returns

The Document that was upserted contained within a Task object representing the service response for the asynchronous operation.