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

Confusing message with hardcoded operator name on empty $set

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 2.7.1
    • Affects Version/s: 2.6.0, 2.6.1
    • Component/s: Usability
    • None
    • Server 2.7.1

      > db.test.update({}, { $set : {} });
      WriteResult({
      "nMatched" : 0,
      "nUpserted" : 0,
      "nModified" : 0,
      "writeError" : {
      "code" : 9,
      "errmsg" : "'$set' is empty. You must specify a field like so: {$mod: {<field>: ...}}"
      }
      })

      Ideally should output

      "'$set' is empty. You must specify a field like so: {$set: {<field>: ...}}"

      instead.

            Assignee:
            matt.kangas Matt Kangas
            Reporter:
            valeri.karpov@mongodb.com Valeri Karpov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: