-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
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.
-
Empty show more show less
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.
- is duplicated by
-
NODE-1614 Not authorized to execute command (even though it works with the same connection string when using mongojs)
- Closed