1

I made a Cosmosdb database using sql core api, and made a container named collection1 in which I saved a simple json data which is as follows { "id" : "1", "group" : "a" } I made group as my partition key. Then added a stored procedure and executed the default stored procedure, but I didn't get my json data as result, instead I got " no docs found"

Shreyansh
  • 15
  • 3

1 Answers1

0

I probably know your mistake, you have to define the partition key when you execute stored procedure because Cosmos DB SP demands that.(More details,you could refer to this thread:Delete Documents from Cosmos using Query without Partition Key Specification)

enter image description here

If you didn't define any partition key, then it is identified as empty,the data which doesn't contain group column will be selected out.

Jay Gong
  • 23,163
  • 2
  • 27
  • 32
  • I defined the partition key as /group but still no result. – Shreyansh Nov 08 '19 at 03:57
  • @Shreyansh It should be `a`,the value of pk setting,not the name of pk. – Jay Gong Nov 08 '19 at 05:36
  • @Shreyansh Can't figure out why you deleted the `thanks ,it worked` comment? What happened? Or you need further help? Any further questions, you could post here. – Jay Gong Nov 13 '19 at 02:21
  • @Shreyansh If you think the answer is correct here, you could mark it which is beneficial for others.If you are not familiar with my words,please scan this SO rules:https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – Jay Gong Nov 13 '19 at 02:23