DocumentClient.DeleteDocumentAsync Method

Definition

Overloads

DeleteDocumentAsync(String, RequestOptions)

Delete a Document from the Azure DocumentDB database service as an asynchronous operation.

DeleteDocumentAsync(Uri, RequestOptions)

Delete a document as an asynchronous operation from the Azure DocumentDB database service.

DeleteDocumentAsync(String, RequestOptions)

Delete a Document from the Azure DocumentDB database service as an asynchronous operation.

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Document>> DeleteDocumentAsync (string documentLink, Microsoft.Azure.Documents.Client.RequestOptions options = null);
Parameters
documentLink
String

The link of the Document to delete. E.g. dbs/db_rid/colls/col_rid/docs/doc_rid/

options
RequestOptions

(Optional) The request options for the request.

Returns

A System.Threading.Tasks containing a ResourceResponse<TResource> which will contain information about the request issued.

Exceptions

If documentLink is not set.

This exception can encapsulate many different types of errors. To determine the specific error always look at the StatusCode property. Some common codes you may get when creating a Document are:

StatusCodeReason for exception
404NotFound - This means the resource you tried to delete did not exist.

DeleteDocumentAsync(Uri, RequestOptions)

Delete a document as an asynchronous operation from the Azure DocumentDB database service.

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Document>> DeleteDocumentAsync (Uri documentUri, Microsoft.Azure.Documents.Client.RequestOptions options = null);
Parameters
documentUri
Uri

the URI of the document to delete.

options
RequestOptions

The request options for the request.

Returns

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