(node:3341) DeprecationWarning: Mongoose: mpromise

Here’s what worked for me to clear up the issue, after reading docs:
http://mongoosejs.com/docs/promises.html

The example in the doc is using the bluebird promise library but I chose to go with native ES6 promises.

In the file where I’m calling mongoose.connect:

mongoose.Promise = global.Promise;
mongoose.connect('mongodb://10.7.0.3:27107/data/db');

[EDIT: Thanks to @SylonZero for bringing up a performance flaw in my answer. Since this answer is so greatly viewed, I feel a sense of duty to make this edit and to encourage the use of bluebird instead of native promises. Please read the answer below this one for more educated and experienced details. ]

Leave a Comment