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

v2.6.0-rc0 update $position - slightly incorrect error message

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 3.3.2
    • Affects Version/s: 2.6.0-rc0, 2.6.11, 3.2.1, 3.3.1
    • Component/s: Write Ops
    • Labels:
    • Fully Compatible

      This update

      > db.test.update({x : 1}, {$push : {a : {$each : [3,4], $position : -1}}})
      WriteResult({
              "nMatched" : 0,
              "nUpserted" : 0,
              "nModified" : 0,
              "writeError" : {
                      "code" : 2,
                      "errmsg" : "The $position value in $push must be positive."
              }
      })
      

      correctly fails with the message "The $position value in $push must be positive.". The message is slightly incorrect though because valid values are positive and 0 (non negative).

            Assignee:
            james.wahlin@mongodb.com James Wahlin
            Reporter:
            nightroman Roman Kuzmin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: