Can't use mLab anymore

Hey Guys.

First of all thanks for all this website. I really appreciate.

I’m trying to learn MongoDB so I follow the instruction of yours and I found the mLab doesn’t allow new user anymore so I should use MongoDB Atlas instead

I can’t succeed to access the database yet but I think It’s not a big deal. It looks just a version problem.
anyway I just wanted to let you know that it’s better to change the instruction


Any solution to this??

The instructions work pretty much the same on atlas.


You can just use MongoDB Atlas. The only difference is that You must allow access to everyone to the Mongo DB Instance:

  1. Go to
  2. After login, go to Security -> Network Access.
  3. Click on Add IP Address. Where it says Whitelist Entry, write
  4. Click on Confirm and wait a few minutes.

I must warn You though that this is risky for production. For any database, You should only allow a specific IP or range to access the services, but since this is for testing it would be fine. The ideal is to set the Whitelist Entry as the IP of the service that’s trying to access it (, I suppose).

You need to create the database beforehand, otherwise You’ll receive an error that the database and/or collections doesn’t exist.

I get the following error when running npm start:
throw new MongooseError('The uri parameter to openUri() must be a ’ +

I have set my dependencies:

“dependencies”: {
“express”: “^4.16.4”,
“body-parser”: “^1.19.0”,
“mongoose”: “^5.7.7”

In my myApp.js :
const mongoose = require(‘mongoose’);

Then my .env file:
MONGO_URI = "mongodb+srv://"

Password obviously contains my user password. What am I missing?

Any help would be amazing!