IDocumentWriter<TDocument>.PatchDocumentAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Patches a document.
public:
System::Threading::Tasks::Task<System::Cloud::DocumentDb::IDatabaseResponse<TDocument> ^> ^ PatchDocumentAsync(System::Cloud::DocumentDb::RequestOptions<TDocument> ^ options, System::String ^ id, System::Collections::Generic::IReadOnlyList<System::Cloud::DocumentDb::PatchOperation> ^ patchOperations, System::String ^ filter, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Cloud.DocumentDb.IDatabaseResponse<TDocument>> PatchDocumentAsync(System.Cloud.DocumentDb.RequestOptions<TDocument> options, string id, System.Collections.Generic.IReadOnlyList<System.Cloud.DocumentDb.PatchOperation> patchOperations, string? filter, System.Threading.CancellationToken cancellationToken);
abstract member PatchDocumentAsync : System.Cloud.DocumentDb.RequestOptions<'Document> * string * System.Collections.Generic.IReadOnlyList<System.Cloud.DocumentDb.PatchOperation> * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Cloud.DocumentDb.IDatabaseResponse<'Document>>
Public Function PatchDocumentAsync (options As RequestOptions(Of TDocument), id As String, patchOperations As IReadOnlyList(Of PatchOperation), filter As String, cancellationToken As CancellationToken) As Task(Of IDatabaseResponse(Of TDocument))
Parameters
- options
- RequestOptions<TDocument>
The request options.
- id
- String
The document id requested to patched.
- patchOperations
- IReadOnlyList<PatchOperation>
The patch operations to be applied.
- filter
- String
The predicate filter to be checked before patch applied.
- cancellationToken
- CancellationToken
The token represents request cancellation.
Returns
A Task containing a IDatabaseResponse<T> that wraps the result document.
Exceptions
Thrown when an error occurred on a client side. For example on a bad request, permissions error or client timeout.
Thrown when an error occurred on a database server side, including internal server error.
Thrown when a request failed but can be retried. This includes throttling and server not available cases.
A generic exception thrown in all other not covered above cases.