Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid mongodb uri Must begin with "mongodb://"

Any idea why i get this error?

this is the connect line

mongoose.connect("mongodb+srv://danielkmx:"+process.env.MONGO_ATLAS_PW+"@node-rest-shop-5xfup.mongodb.net/test", {     useMongoClient:true }); 
like image 332
Daniel Bezerra De Menezes Avatar asked Feb 26 '18 02:02

Daniel Bezerra De Menezes


People also ask

How can I get URI in MongoDB?

Find MongoDB URIClick on “Overview” tab in the menu bar. Scroll down the Overview page and you will see the MongoDB URI information.

How do I access MongoDB on localhost?

By default, MongoDB starts at port 27017. But you can access it in a web browser not at that port, rather, at a port number 1000 more than the port at which MongoDB is started. So if you point your browser to http://localhost:28017, you can see MongoDB web interface.


1 Answers

I had the same error, and it got resolved when I updated the mongoose package to the latest version.

like image 194
Sethuraman Srinivasan Avatar answered Sep 21 '22 14:09

Sethuraman Srinivasan