Share via


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Container.PatchItemStreamAsync 方法

定义

将 Azure Cosmos 服务中的项修补为异步操作。

public abstract System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ResponseMessage> PatchItemStreamAsync (string id, Microsoft.Azure.Cosmos.PartitionKey partitionKey, System.Collections.Generic.IReadOnlyList<Microsoft.Azure.Cosmos.PatchOperation> patchOperations, Microsoft.Azure.Cosmos.PatchItemRequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member PatchItemStreamAsync : string * Microsoft.Azure.Cosmos.PartitionKey * System.Collections.Generic.IReadOnlyList<Microsoft.Azure.Cosmos.PatchOperation> * Microsoft.Azure.Cosmos.PatchItemRequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ResponseMessage>
Public MustOverride Function PatchItemStreamAsync (id As String, partitionKey As PartitionKey, patchOperations As IReadOnlyList(Of PatchOperation), Optional requestOptions As PatchItemRequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ResponseMessage)

参数

id
String

Cosmos 项 ID

partitionKey
PartitionKey

项的分区键。

patchOperations
IReadOnlyList<PatchOperation>

表示要按顺序应用于所引用 Cosmos 项的操作的列表。

requestOptions
PatchItemRequestOptions

(可选) 项请求的选项。

cancellationToken
CancellationToken

(表示请求取消的可选) CancellationToken

返回

包含 Task 的 , ResponseMessage 它包装 Stream 包含已修补的资源记录的 。

示例

PatchItemAsync<T>(String, PartitionKey, IReadOnlyList<PatchOperation>, PatchItemRequestOptions, CancellationToken)

注解

项的分区键值是不可变的。 若要更改项的分区键值,必须删除原始项并插入新项。 修补操作是原子操作,按顺序执行。 默认情况下,资源正文将作为响应的一部分返回。 用户可以通过将标志设置为 EnableContentResponseOnWrite false 来请求无内容。

适用于