Hello Team,
I have cosmosdb setup for one of my requirements. The cosmosdb is accessed using its REST API functionality.
The cosmosdb is partitioned one key called let's cid. So overall the REST call looks like ,
https://{{DocumentDBHost}}/dbs/mydb/colls/mycol/docs/123
This works perfectly fine.
In the JSON document we also have few more fields/attributes like oid and sid.
Now we have an additional requirement that we want to query on multiple such ids. Suppose we have one attribute as oid (value 222) and one attribute as sid(333). If user uses any of these ids, the cosmosdb should return the JSON.
So essentially if user passes any of these
https://{{DocumentDBHost}}/dbs/mydb/colls/mycol/docs/123 //For cid
https://{{DocumentDBHost}}/dbs/mydb/colls/mycol/docs/222 //For oid
https://{{DocumentDBHost}}/dbs/mydb/colls/mycol/docs/333 //For sid
User wants this to get resolved internally. So if he passes any number as id, cosmosdb should search across these 3 type of ids ( attributes of JSON) and should be able to resolve it or find the correct document.
What's the best way to achieve it? Is there any way to have multiple partition keys at the same time which can resolve it?
Thanks,
Raja