max_item_count breaks paginated query with python Azure Cosmos sdk?
I’m attempting to create a paginated query with FastAPI and the Python Azure Cosmos SDK. The pagination is successful when the max_item_count is specified at 1, but anything greater and there are 2 breaking scenarios.
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.