$where with invalid syntax returns unfriendly error message

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.1.8
    • Component/s: JavaScript
    • None
    • Fully Compatible
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      > 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
      }
      

            Assignee:
            DO NOT USE - Backlog - Platform Team
            Reporter:
            Adam Midvidy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: