Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html
操作数据库的时候,老是提示:Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html
增删改都没有问题,但是很影响排错。
解决办法:在连接数据库的时候,添加mongoose.Promise = global.Promise;
mongoose.connect(url, mongoOptions);
mongoose.Promise = global.Promise; mongoose.connection.on('error', function (err) { console.log('Mongo Error:' + err); }).on('open', function () { console.log('Connection opened'); });