Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mongoose's default promise library is deprecated in MEAN stack

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, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html

I tried to search some answers here but the one that I found wasn't clear enough for me:

(node:3341) DeprecationWarning: Mongoose: mpromise

I found the file calling the mongoose.connect, but the codes on that issue didn't work for me, can anyone explain for me how it works?

like image 536
Joao Luiz Magalhaes Avatar asked Aug 30 '16 13:08

Joao Luiz Magalhaes


1 Answers

use this code,before the mongo connection and this will resolve the promise problem.

mongoose.Promise = global.Promise;
like image 142
KARTHIKEYAN.A Avatar answered Sep 18 '22 02:09

KARTHIKEYAN.A