Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-5081

bson libruary can't be used

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 1
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      https://github.com/mongodb/js-bson#bugs--feature-requests

      npm install bson

      then:

      import

      { BSON, EJSON, ObjectId }

      from 'bson';

       

      When in node app I am using "bson" library, this is error I get:

      node app.js
      .../src/node_modules/bson/lib/bson.mjs:95
      const nodejsRandomBytes = await (async () => {
                                                              ^^^^^

      SyntaxError: Unexpected reserved word
          at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            mamap2000@gmail.com Nego Yoir
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: