问题
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