$each must check its parms

XMLWordPrintableJSON

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

      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
              Reporter:
              Dwight Merriman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: