Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-5769

Fix mongoize update all array operators master

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 8.1.6, 9.0.1
    • 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" =>

      { genres: "electronic" }

      )

      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:

            Assignee:
            jamis.buck@mongodb.com Jamis Buck
            Reporter:
            jamis.buck@mongodb.com Jamis Buck
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: