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

bad error message when attempting to $pop from a non-array field

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

      Here is the error string that an update with $pop returns if the field we try to pop from is not an array:

      > db.x.drop()
      true
      > db.x.save({_id: NumberInt(3), a: 1})
      > db.x.update({}, {$pop: {a: 1}})
      Can only $pop from arrays. INVALID-MUTABLE-ELEMENT has the field a of non-array type NumberDouble
      

      The problem is that INVALID-MUTABLE-ELEMENT is displayed instead of properly printing the _id of the document on which the update failed.

            Assignee:
            scotthernandez Scott Hernandez (Inactive)
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: