You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Either the doc need to be updated to remove the user/pass backwards compat (which appears broken) or it needs to set username instead of user in the auth object.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
As described in https://mongoosejs.com/docs/connections.html#options:
Should forward the auth to the nodejs driver. Looking at the object sent to the driver:
Looking at https://github.com/mongodb/node-mongodb-native/blob/4.0/docs/CHANGES_4.0.0.md#authentication, it says the expected format is
username
and notuser
, as the error suggests:MongoParseError: credentials must be an object with 'username' and 'password' properties
.Noting that the following works:
Either the doc need to be updated to remove the user/pass backwards compat (which appears broken) or it needs to set
username
instead ofuser
in theauth
object.What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
MongoDB 3.4
Mongoose 6.0.5
NodeJS v14.17.6
Here is the code responsible for the bug:
mongoose/lib/connection.js
Lines 742 to 750 in e6820ee
The text was updated successfully, but these errors were encountered: