MongoDB and Mongoose - Install and Set Up Mongoose need help!

MongoDB and Mongoose - Install and Set Up Mongoose need help!

"dependencies": {
		"express": "^4.12.4",
		"body-parser": "^1.15.2",
    "mongodb" : "^3.6.8",
    "mongoose" : "^5.3.9"

const mongoose = require('mongoose');

MONGO_URI=mongodb://simba:[email protected]:31963/databazz

The error says mongoose isn’t connected…plzz help!!


Hi, I think you don’t need to add mongo dependency. But you need to import .env, and add the uri in .env file.
Check on your mlab account the exact url of the db, it includes mongodb:// at begining.

Best regards


You called MONGO_URI before you set the actual variable.

Put the line below before the one about mongoose.connect()

const MONGO_URI="mongodb://simba:[email protected]:31963/databazz"

Follow this Getting Started instructions from the mongoose docs for more details.


I’ve included mongodb:// in the beginning,…it’s still not working…


It’s not working…!!!


You’re reading the MONGO_URI from process.env, did you setup that correctly? If not you can always use directly like:

const mongoose = require('mongoose');
mongoose.connect('simba:[email protected]:31963/databazz');


Can anyone help…I’ve now deleted the previous user and changed the password in a way that it not includes special characters…still it’s showing error.