DocumentClient.ReplaceDocumentAsync
Method
Definition
Overloads
| ReplaceDocumentAsync(Document, RequestOptions) |
Replaces a Document in the Azure DocumentDB database service as an asynchronous operation. |
| ReplaceDocumentAsync(String, Object, RequestOptions) |
Replaces a Document in the Azure DocumentDB database service as an asynchronous operation. |
| ReplaceDocumentAsync(Uri, Object, RequestOptions) |
Replaces a document as an asynchronous operation in the Azure DocumentDB database service. |
ReplaceDocumentAsync(Document, RequestOptions)
Replaces a Document in the Azure DocumentDB database service as an asynchronous operation.
public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Document>> ReplaceDocumentAsync (Microsoft.Azure.Documents.Document document, Microsoft.Azure.Documents.Client.RequestOptions options = null);
- options
- RequestOptions
(Optional) The request options for the request.
A System.Threading.Tasks containing a ResourceResponse<TResource> which wraps a Document containing the updated resource record.
If document 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:
| StatusCode | Reason for exception |
|---|---|
| 404 | NotFound - This means the resource you tried to delete did not exist. |
ReplaceDocumentAsync(String, Object, RequestOptions)
Replaces a Document in the Azure DocumentDB database service as an asynchronous operation.
public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Document>> ReplaceDocumentAsync (string documentLink, object document, Microsoft.Azure.Documents.Client.RequestOptions options = null);
- documentLink
- String
The link of the document to be updated. E.g. dbs/db_rid/colls/col_rid/docs/doc_rid/
- options
- RequestOptions
(Optional) The request options for the request.
A System.Threading.Tasks containing a ResourceResponse<TResource> which wraps a Document containing the updated resource record.
If either documentLink or document 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:
| StatusCode | Reason for exception |
|---|---|
| 404 | NotFound - This means the resource you tried to delete did not exist. |
ReplaceDocumentAsync(Uri, Object, RequestOptions)
Replaces a document as an asynchronous operation in the Azure DocumentDB database service.
public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.Document>> ReplaceDocumentAsync (Uri documentUri, object document, Microsoft.Azure.Documents.Client.RequestOptions options = null);
- documentUri
- Uri
the URI of the document to be updated.
- document
- Object
the updated document.
- options
- RequestOptions
The request options for the request.
The task object representing the service response for the asynchronous operation.