使用mongoose进行数据库操作时,总是提示:
(node:5684) DeprecationWarning: 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;
只需要加此条命令便可清除警告:
var db = mongoose.connect("mongodb://127.0.0.1:27017/mongooseTest");