-
Type: Bug
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
Fully Compatible
Mongoid's #upsert method misuses the driver's #update_one method, because Mongoid actually provides a replacement document hence should use #replace_one, not #update_one. This was flagged by the change in https://jira.mongodb.org/browse/RUBY-2996.
This change should be backported as far back as is practical (for example through 7.3) so that when driver 2.18 is released with a warning for https://jira.mongodb.org/browse/RUBY-2996, users can update their Mongoid versions within each minor release to not have Mongoid-originated warnings.
Note that this ticket does not change behavior - Mongoid will use continue performing a replacing upsert and but will do it correctly via replace_one instead of incorrectly via update_one. Changing to an updating upsert is covered by https://jira.mongodb.org/browse/MONGOID-5363.
- related to
-
RUBY-2996 Implement update and replace validation
- Closed
-
MONGOID-5363 Change #upsert to perform updating upsert rather than replacing upsert
- Closed
- links to