Server Discovery And Monitoring engine is deprecated

后端 未结 23 1243
执笔经年
执笔经年 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:13

    I was also facing the same issue:

    1. I made sure to be connected to mongoDB by running the following on the terminal:

      brew services start mongodb-community@4.2
      

      And I got the output:

      Successfully started `mongodb-community`
      

    Instructions for installing mongodb at
    https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/ or https://www.youtube.com/watch?v=IGIcrMTtjoU

    1. My configuration was as follows:

      mongoose.connect(config.mongo_uri, {
          useUnifiedTopology: true,
          useNewUrlParser: true})
          .then(() => console.log("Connected to Database"))
          .catch(err => console.error("An error has occured", err));
      

    Which solved my problem!

提交回复
热议问题