查询 DocumentDB 中的分区列表(and/or 分区键值)

Query list of partitions (and/or partition key values) in DocumentDB

我正在使用分区集合作为持久性解决方案。

我正在寻找一种方法来列出我拥有的分区数并获取集合中每个分区的分区键值。但我无法从 .NET SDK 中找到任何东西来实现这一点。你能帮忙吗?

您可以使用 DocumentDB 中的 Get Partition Key Ranges AI 检索分区键范围(物理分区)列表:https://docs.microsoft.com/en-us/rest/api/documentdb/get-partition-key-ranges

But I could not find anything from .NET SDK to achieve this. Could you please help?

我已与 Microsoft Azure DocumentDB Client and you could leverage DocumentClient.ReadPartitionKeyRangeFeedAsync for getting Partition key ranges. Additionally, for the similar issue, you could leverage ILSpy 核对过,以检查 SDK 库中特定 REST API 的相关请求 URI。