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

thanks

Any solution to this??

The instructions work pretty much the same on atlas.

Hello!

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 atlas.mongodb.com.
  2. After login, go to Security -> Network Access.
  3. Click on Add IP Address. Where it says Whitelist Entry, write 0.0.0.0/0.
  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 (glitch.com, 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”,
“mongodb”:"^3.3.3",
“mongoose”: “^5.7.7”
},

In my myApp.js :
const mongoose = require(‘mongoose’);
mongoose.connect(process.env.MONGO_URI)

Then my .env file:
MONGO_URI = "mongodb+srv://Dewald:password@cluster-4ttls.mongodb.net/test?retryWrites=true&w=majority"

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

Any help would be amazing!