在Microsoft.Azure.Cosmos.Client上跨分区启用查询 [英] Enable query across partitions on Microsoft.Azure.Cosmos.Client

查看:77
本文介绍了在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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆