Skip to content Skip to sidebar Skip to footer

Azure Cosmos Db, Delete Ids (definitely Exist)

This is probably a very simple and silly mistake but I am unsure of how this is failing. I have used the https://github.com/Azure/azure-cosmos-python#insert-data tutorial. How can

Solution 1:

When specifying the partition key in the call to client.DeleteItem(), you chose:

{'partitionKey': 'class'}

The extra parameter to DeleteItem() should be specifying the value of your partition key.

Per your comments, /class is your partition key. So I believe that, if you change your parameter to something like:

{'partitionKey': 'value-of-partition-key'}

This should hopefully work.

Solution 2:

More than likely the issue is with mismatched id and PartitionKey value for the document. A document is uniquely identified in a collection by combination of it's id and PartitionKey value.

Thus in order to delete a document, you need to specify correct values for both the document's id and it's PartitionKey value.

Post a Comment for "Azure Cosmos Db, Delete Ids (definitely Exist)"