Upsert of Mongo API not working with Azure Cosmos DB Upsert of Mongo API not working with Azure Cosmos DB mongoose mongoose

Upsert of Mongo API not working with Azure Cosmos DB


Yes, based on the doc MongoDB query language support , upsert() command is not supported by cosmos db mongo api. As I known, no shortcuts here so far. You need to encapsulate methods to determine whether a document exists, and then decide to insert or update.

Or, just to declare that the Cosmos Document DB SDK supports Upsert method. Please refer to the case: How can I perform an UPSERT using Azure DocumentDB?.
Cosmos Document DB is a good choice if you could do data migrations.

Hope it helps you.