Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-4509

$each must check its parms

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.5.2
    • Affects Version/s: None
    • Component/s: Write Ops
    • Labels:
    • ALL

      it's easy to pass an object instead of an array by mistake. returning an error would be ok but adding something containing "$each" as a field is bad. same check needs to happen if the value is other types.

      > t.update({},{ $addToSet : { a : { $each :

      { "0":3 }

      } } })
      > t.find()
      { "_id" : ObjectId("4eeb4609711dd7183d441894"), "a" : [ 3, 5, 6, { "$each" :

      { "0" : 3 }

      } ] }

            Assignee:
            Unassigned Unassigned
            Reporter:
            dwight@mongodb.com Dwight Merriman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: