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

JavaScript execution failure when querying docs with Native values

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.6.8, 3.1.0
    • Component/s: JavaScript, Shell
    • Labels:
      None
    • ALL
    • Hide

      In the shell run the following:

      db.someCollection.insert({ _id: 0 name: String }) // no quotes around String
      db.someCollection.find({ _id: 0 }) 
      

      Output:

      Mon May 13 12:02:41.878 JavaScript execution failed: SyntaxError: Unexpected identifier
      Error: 16722 JavaScript execution failed: SyntaxError: Unexpected identifier
      
      Show
      In the shell run the following: db.someCollection.insert({ _id: 0 name: String }) // no quotes around String db.someCollection.find({ _id: 0 }) Output: Mon May 13 12:02:41.878 JavaScript execution failed: SyntaxError: Unexpected identifier Error: 16722 JavaScript execution failed: SyntaxError: Unexpected identifier

      Natives can be stored but not returned by a query in the shell. Querying produces a "JavaScript execution" error.

      Same problem with String, Number, Array, Date, Object, Error, Function, RegExp, Boolean.

            Assignee:
            backlog-server-platform DO NOT USE - Backlog - Platform Team
            Reporter:
            aheckmann Aaron Heckmann
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: