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

Setting useNewUrlParser: true in connection causes issue.

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.7
    • Affects Version/s: 3.1.0, 3.1.1
    • Component/s: Core, MongoDB 3.4
    • Environment:
      Found on Ubuntu 18. Not tested in other environments.

      Connecting to MongoDB using mongoose, and passing the option

      Unknown macro: { useNewUrlParser}

      causes the following error:

       
      {{{ MongoError: user is not allowed to do action [find] on [db.employees]}}
      {{ at queryCallback (/home/xx/xx/xx/node_modules/mongodb-core/lib/cursor.js:247:25)}}
      {{ at /home/}}xx/xx/xx/node_modules/mongodb-core/lib/connection/pool.js:531:18
      {{ at _combinedTickCallback (internal/process/next_tick.js:131:7)}}
      {{ at process._tickCallback (internal/process/next_tick.js:180:9)}}
      {{ name: 'MongoError',}}
      {{ message: 'user is not allowed to do action [find] on [bheem.employees]',}}
      {{ ok: 0,}}
      {{ errmsg: 'user is not allowed to do action [find] on [bheem.employees]',}}
      {{ code: 8000,}}
      {{ codeName: 'AtlasError',}}
      {{ [Symbol(mongoErrorContextSymbol)]: {}}}

      But removing the option causes a DeprecationWarning

      (node:10313) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.

       

            Assignee:
            katherine.walker@mongodb.com Katherine Walker (Inactive)
            Reporter:
            p_snehanshu Snehanshu Phukon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: