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

$where with invalid syntax returns unfriendly error message

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 3.1.8
    • JavaScript
    • None
    • Fully Compatible
    • ALL

    Description

      > db.bar.insert({x:1})
      > db.runCommand({find: "bar", filter: {"$where": "INVALID JAVASCRIPT!!!"}})
      {
              "waitedMS" : NumberLong(0),
              "ok" : 0,
              "errmsg" : "Failed to call method",
              "code" : 1
      }
      > db.bar.find({$where: "INVALID JAVASCRIPT!!!!"})
      Error: error: {
              "$err" : "Can't canonicalize query: InternalError Failed to call method",
              "code" : 17287
      }
      

      Attachments

        Activity

          People

            backlog-server-platform DO NOT USE - Backlog - Platform Team
            adam.midvidy Adam Midvidy
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: