Server Discovery And Monitoring engine is deprecated

后端 未结 23 1253
执笔经年
执笔经年 2020-12-01 00:54

I am using Mongoose with my Node.js app and this is my configuration:

mongoose.connect(process.env.MONGO_URI, {
   useNewUrlParser: true,
   useUnifiedTopol         


        
23条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-01 01:10

    mongoose.connect('mongodb://localhost:27017/Tododb', { useNewUrlParser: true, useUnifiedTopology: true });
    

    Will remove following errors:-

    (node:7481) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.

    (node:7481) 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.

提交回复
热议问题