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

Confusing message with hardcoded operator name on empty $set

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial - P5
    • Resolution: Fixed
    • Affects Version/s: 2.6.0, 2.6.1
    • Fix Version/s: 2.7.1
    • Component/s: Usability
    • Labels:
      None
    • Sprint:
      Server 2.7.1

      Description

      > 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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: