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

旧城冷巷雨未停 提交于 2019-12-24 02:56:16

问题


I am using a partitioned collection for as persistence solution.

I am searching for a way to list number of partitions I have and get partition key value for each of them in a collection. But I could not find anything from .NET SDK to achieve this. Could you please help?


回答1:


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

I have checked with Microsoft Azure DocumentDB Client and you could leverage DocumentClient.ReadPartitionKeyRangeFeedAsync for getting Partition key ranges. Additionally, for the similar issue, you could leverage ILSpy to check the SDK library for the related Request URI for the specific REST API.




回答2:


You can retrieve the list of partition key ranges (physical partitions) using the Get Partition Key Ranges AI in DocumentDB: https://docs.microsoft.com/en-us/rest/api/documentdb/get-partition-key-ranges



来源:https://stackoverflow.com/questions/43319308/query-list-of-partitions-and-or-partition-key-values-in-documentdb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!