MongoDB password with “@” in it

前端 未结 16 2017
遇见更好的自我
遇见更好的自我 2020-11-27 14:03

I\'m trying to connect to a MongoDB database with a username and password using Mongoose in Node.js. All the docs say that the connection string should look like

<         


        
16条回答
  •  悲&欢浪女
    2020-11-27 14:26

    Use this,

    mongoose.connect(process.env.MONGO_URI, { useNewUrlParser: true}).then(()=>console.log("DB connected"));
    

提交回复
热议问题