错误提示如下:(node:2728) 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.

nodejs连接MongoDB数据库运行时报错:(node:2728) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version.

 

 运行台报错如下

nodejs连接MongoDB数据库运行时报错:(node:2728) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version.

 

nodejs连接MongoDB数据库运行时报错:(node:2728) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version.

 

 解决方案:

 nodejs连接MongoDB数据库运行时报错:(node:2728) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version.

 

 如图中红色标记,添加提示的内容,问题解决啦

相关文章:

  • 2022-02-02
  • 2021-08-15
  • 2022-12-23
  • 2021-10-10
  • 2021-05-15
  • 2022-12-23
猜你喜欢
  • 2021-09-06
  • 2021-09-23
  • 2022-12-23
  • 2022-02-11
  • 2022-12-23
  • 2021-06-10
  • 2021-10-20
相关资源
相似解决方案