I am using RESTfull HTTP request to fetch the Partition Key of a collection. I am doing:
response = client.GetStringAsync(new Uri(baseUri, resourceLink)).Result;
var data3 = (JObject)JsonConvert.DeserializeObject(response);
if (data3["partitionKey"] != null)
{
string partitionKey = data3["partitionKey"]["paths"][0].ToString();
string PartitionKey = partitionKey.Substring(1);
return PartitionKey;
}
Is there a more efficient way to do this? Do their SDK's have a direct way to fetch the Partition Key?
UPDATE
My response on fetching partition key range is:
item={
"_rid": "lIB0ALrgyAACAAAAAAAAUA==",
"id": "0",
"_etag": "\"00000000-0000-0000-0318-18b49de501d4\"",
"minInclusive": "",
"maxExclusive": "FF",
"ridPrefix": 0,
"_self": "dbs/lIB0AA==/colls/lIB0ALrgyAA=/pkranges/lIB0ALrgyAACAAAAAAAAUA==/",
"throughputFraction": 1.0,
"status": "online",
"parents": [],
"_ts": 1528895512
}
How does this take me close to finding out what the partition key is?