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

Misleading error message "Invalid modifier specified: $set"

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      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

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

              Created:
              Updated:
              Resolved: