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

improve error message for top level $not expression

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 5.0.1
    • 5.2.0
    • None
    • Fully Compatible
    • QO 2021-11-01

    Description

      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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: