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

$pop causes "can't apply mod in place - shouldn't have gotten here " - need to fix error message

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • 1.6.4
    • Usability
    • None
    • OS: Debian x64
    • ALL

    Description

      During the past week I have started getting this error when performing
      an update in Mongo. This was a working query and now it fails.

      > db.mycollection.update(

      { "a.b" : 665 }

      , { $pop : { "c" :

      { "d" : 1153 }

      } });

      "can't apply mod in place - shouldn't have gotten here"

      mongo.log shows the following
      "Tue Dec 7 16:10:12 [conn4] update liststore.individuals query:

      { a.b: 665.0 }

      exception 10144 can't apply mod in place - shouldn't
      have gotten here 0ms"

      "a.b" is an indexed long
      "c" is a collection containing an array
      "d" is a field for each document within "c"

      OS: Debian x64
      Mongo: 1.6.4

      Answer: Turns out that $pull, should be used instead of $pop.

      The error message was not clear and could use a little attention

      Attachments

        Activity

          People

            Unassigned Unassigned
            roubicek1 Ben Roubicek
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: