[MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
(Use node --trace-warnings ...
to show where the warning was created
当前的服务器发现和监视引擎已弃用,并将在将来的版本中删除。要使用新的服务器发现和监控引擎,请将选项{useUnifiedTopology:true}传递给MongoClient构造函数。
(使用“node–trace warnings…”显示创建警告的位置
修改前
mongoose: {
client: {
// 链接到本地的MongoDB,note是我本地数据库的名字
url: 'mongodb://127.0.0.1:27017/note',
options: {
// dbName: 'note',
useNewUrlParser: true,
},
},
},
修改后
mongoose: {
client: {
// 链接到本地的MongoDB,note是我本地数据库的名字
url: 'mongodb://127.0.0.1:27017/note',
options: {
// dbName: 'note',
// useNewUrlParser: true,
useUnifiedTopology: true,
},
},
},