-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
ALL
-
-
None
-
None
-
None
-
None
-
None
-
None
-
None
When the user doesn't specify "on" field for $merge, it default to _id (+ shard key for sharded collections).
When the default value is used for "on", there is no validation that there is actually a unique index to support the $merge, because we assume that the default value of "on" is definitely unique.
But this doesn't account for collation, as the values of _id might not be unique, according to the providing collation, which might lead to $merge perfoming whenNotMatched action, while actually a matching document exists.
See repro.js![]()
- is related to
-
SERVER-115813 $merge doesn't forward collation to underlying updates
-
- Closed
-
- related to
-
SERVER-109034 $merge execution uses update when insert may be more efficient
-
- Closed
-