MongoDB password with “@” in it

前端 未结 16 2015
遇见更好的自我
遇见更好的自我 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:34

    This one worked for me

    This one is a MongoDB 2020 Update If You're using a separate env file then just add your

    mongoose.connect('url',
    {
        useNewUrlParser: true, 
        useUnifiedTopology: true 
    });
    

提交回复
热议问题