在Microsoft.Azure.Cosmos.Client上跨分区启用查询 [英] Enable query across partitions on Microsoft.Azure.Cosmos.Client
问题描述
我正在使用.NET Core Cosmos DB Client NuGet包Microsoft.Azure .Cosmos v3.4.4
I'm using the .NET Core Cosmos DB Client NuGet package Microsoft.Azure.Cosmos v3.4.4
我需要跨分区查询,但是我还没有找到如FeedOptions.EnableCrossPartitionQuery
这样的方法,如下面的文章所述
https://docs.microsoft.com/zh-CN/azure/cosmos-db/how-to-query-container
I need to query across partitions, but I haven't found how to do this like FeedOptions.EnableCrossPartitionQuery
as described in the following article
https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-query-container
如何启用跨分区查询?
推荐答案
在V3中默认启用跨分区查询.
Cross partition queries are enabled by default in V3.
如果您确实在QueryRequestOptions
中指定了PartitionKey
,它将成为单个分区查询.
If you do specify a PartitionKey
in the QueryRequestOptions
, it becomes a single partition query.
这篇关于在Microsoft.Azure.Cosmos.Client上跨分区启用查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!