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

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: 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
    • Fully Compatible
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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
            Reporter:
            Roman Kuzmin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: