-
Type: Task
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: 9.0.0, 8.1.5
-
Component/s: Persistence
-
None
-
Ruby Drivers
Via GitHub:
Issue when using $pull or $pop with update_all
Atomic operators that deal with arrays or sets: $addToSet, $push, $pull, $pop, $pullAll
Only $addToSet and $push are covered by current tests and $pull, $pop functionality is broken as Mongoid::AtomicUpdatePreparer.mongoize_for returns nil for query such as update_all("$pull" =>
)
This became an issue after fixes from #5814 as correct key is now being passed to Mongoid::AtomicUpdatePreparer.mongoize_for
Fix is to mongoize value the same way it is for $addToSet or $push.
Also added tests for $pullAll even though it is currently working but good to have all operators covered.
See pull requests:
- https://github.com/mongodb/mongoid/pull/5823 (Mongoid master branch)
- https://github.com/mongodb/mongoid/pull/5824 (backport to 8.1-stable)