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

Misleading error message "Invalid modifier specified: $set"

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • None
    • None

    Description

      The error message Invalid modifier specified: $set, at a first glance, suggests that '$set' itself is an invalid modifier. I'm not the only one to read it that way; see also this StackOverflow comment.

      This happens when (accidentally) running an update() with {$set: null}.

      The message would be less misleading and more useful if it output the precise value of the modifier (not just $set). For example:

      Invalid modifier specified for $set: null

      Attachments

        Activity

          People

            Unassigned Unassigned
            dandv Dan Dascalescu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: