I\'m trying to start a MEAN-stack server, however I\'m getting this error msg:
Mongoose: mpromise (mongoose\'s default promise library) is deprecated,
Latest mongoose library, do not use any default promise library. And from Mongoose v 4.1.0 you can plug in your own library.
If you are using mongoose library(not underlying MongoDB driver) then you can plug in promise library like this:
//using Native Promise (Available in ES6)
mongoose.Promise = global.Promise;
//Or any other promise library
mongoose.Promise = require('bluebird');
//Now create query Promise
var query = someModel.find(queryObject);
var promise = query.exec();
If you are using MongoDB Driver then you will need to do some extra effort. Because, mongoose.Promise sets the Promise that mongoose uses not the driver. You can use the below code in this case.
// Use bluebird
var options = { promiseLibrary: require('bluebird') };
var db = mongoose.createConnection(uri, options);