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

improve error message for top level $not expression

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.2.0
    • Affects Version/s: 5.0.1
    • Component/s: None
    • Fully Compatible
    • QO 2021-11-01

      In 4.4 and earlier, the error message for top level `$not` was:

      "errmsg" : "unknown top level operator: $not"

      Unfortunately in 5.0 it became possibly more confusing:

      "unknown top level operator: $not. If you have a field name that starts with a '$' symbol, consider using $getField or $setField."

      I propose we special case the error when $not is used as top level operator to instead add:
      "unknown top level operator: $not. If you are trying to negate entire expression use $nor

            Assignee:
            matt.boros@mongodb.com Matt Boros
            Reporter:
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: