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

Add support for ES6 symbol type to shell and server-side JS

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: 3.1.6
    • Fix Version/s: Backlog
    • Component/s: JavaScript, Shell
    • Labels:
    • Sprint:
      Dev Tools 2019-11-04

      Description

      ES6 adds support for a symbol type. This type is not supported in our shell and server-side JS, even though SpiderMonkey provides native support:

      // Shell
      > db.foo.insert({a: Symbol()});
      2015-07-22T15:17:17.176-0400 E QUERY    [thread1] Error: unable to convert JavaScript property to mongo element a :
      Bulk/addToOperationsList@src/mongo/shell/bulk_api.js:600:22
      Bulk/this.insert@src/mongo/shell/bulk_api.js:647:14
      DBCollection.prototype.insert@src/mongo/shell/collection.js:256:13
      @(shell):1:1
       
      // Server-side JS
      > db.eval('db.foo.insert({a: Symbol()});');
      WARNING: db.eval is deprecated
      2015-07-22T15:18:00.853-0400 E QUERY    [thread1] Error: {
      	"ok" : 0,
      	"errmsg" : "Error: unable to convert JavaScript property to mongo element a :\nBulk/addToOperationsList@src/mongo/shell/bulk_api.js:600:22\nBulk/this.insert@src/mongo/shell/bulk_api.js:647:14\nDBCollection.prototype.insert@src/mongo/shell/collection.js:256:13\n_funcs1@:1:30\n",
      	"code" : 16662
      } :
      _getErrorWithCode@src/mongo/shell/utils.js:23:13
      DB.prototype.eval@src/mongo/shell/db.js:542:1
      @(shell):1:1
      

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

              • Created:
                Updated: