Mongoose: "Db.prototype.authenticate method will no longer be available in the next major release..."

Created on 16 Oct 2017  路  2Comments  路  Source: Automattic/mongoose

"Db.prototype.authenticate method will no longer be available in the next major release..."
I got it since 4.11. Still exists in 4.12.2
Any news about this warning?

Most helpful comment

Thanks @UmarEhsan, useMongoClient: true is the option I was missing.

All 2 comments

For Db.prototype.authenticate method will no longer be available Error try this.
var mongoose = require('mongoose');
mongoose.Promise = global.Promise;

mongoose.connect( "mongodb://username:[email protected]:25146/dbName'", { useMongoClient: true } );

For MongoLab
Make sure you are using the database username and password not the account username and password from Mlab.
In MLab, formerly MongoLab, do the following
Navigate to Users
@add Database User
Choose your username and password

Thanks @UmarEhsan, useMongoClient: true is the option I was missing.

Was this page helpful?
0 / 5 - 0 ratings