错误提示:
(node:357046) [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.
解决方案:
连接mongo数据库的时候,选项添加{ useUnifiedTopology: true }
即可。
await mongodb.MongoClient.connect(dbUrl, { useNewUrlParser: true, useUnifiedTopology: true });