Relative Content

Tag Archive for pythonazure-cosmosdb

CosmosDB Python SDK replace_item and upsert_item delete the record instead of updating it

I have a script that fetches a certain record, if it exists, and modifies its properties before updating it in the database using replace_item or upsert_item. If I fetch the entire record, change the properties and use that record as both the item and body, it works properly.
But, if I decide I to just fetch the ID of the document (to save on RU), put the id into a new object with the adequate properties, then update using the id and new document, the document gets deleted inexplicably.