How to make a MongoDB Upsert truly idempotent?
I want to insert a document into a MongoDB in an idempotent way. The explanation provided by the MongoDB documentation, and also here on SO, is to use the upsert=True modifier. However, to my understanding, this does not guarantee idempotence, because an already existing document could be modified. The operation I am looking for is as follows: If the document, identified by some key, does not exist, insert it. If a document with the given key already exists, there are two things that might happen: The existing document and the provided document are exactly the same. Then, return the same resul
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.