Details
-
Improvement
-
Resolution: Done
-
Minor - P4
-
None
-
None
Description
The findAndModify() documentation reads, on the upsert option:
When true, findAndModify() creates a new document if no document matches the query, or if documents match the query, findAndModify() performs an update. To avoid multiple upserts, ensure that the query fields are uniquely indexed.
IIUC, replaceOne has the same behavior, but we don't warn about the need for unique indexes when upsert is set to true.
This ticket is to suggest adding the quoted paragraph above to the replaceOne() documentation.
Attachments
Issue Links
- is related to
-
SERVER-22607 Duplicate key error on replace with upsert
-
- Closed
-