这是我连接到猫鼬数据库的代码:
mongoose.connect('mongodb://localhost/statistic_analysis', { useUnifiedTopology: true, useNewUrlParser: true, useCreateIndex: true })
我通过了命令行建议的useunifiedTopology选项。 但这仍然给了我弃用警告
(node:4594) DeprecationWarning: 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.
我几乎可以找到每条建议,都在高低搜寻。仍然给我警告。我也尝试过使用MongoClient构造函数。仍然给出错误。我要去哪里错了?