1.DeprecationWarning: open() is deprecated in mongoose >= 4.11.0, use openUri() instead, or set the useMongoClient option if using connect() or createConnection(). See http://mongoosejs.com/docs/connections.html#use-mongo-client
mongoose.connect(‘mongodb://localhost/test’,{useMongoClient:true})
2.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
本文解决了Mongoose中两个常见的弃用警告:使用openUri()替代open()方法及替换默认Promise库的操作步骤。
3498

被折叠的 条评论
为什么被折叠?



