How to setup a online Mongo-DB database using mLab.

Database can seem like magic at time in the fact that installing it can be a headache. Especially when most tutorials don’t go in depth at all about database. Most data storage happening in a json file.

So I’ll will demonstrate how to setup a mongodb database instance using mLab.

First go to the homepage.

And sign up

After that verify account, and go to dashboard.

The MongoDB Deployments section is where you can create new databases. Then press the create new button.

Pick the amazon and free option, and pick any area, doesn’t matter as long it is free, and amazon. Next Have your database named anything you like, but I will be naming e-commerce-database, and latest version of mongo.

After that is will say it is order, but it’s free, you shouldn’t have to provide credit card information.

It will show the database created, click the database link, and go to the database page. And click users, and setup your user. Don’t copy and paste the connection string before creating a user.

Then create your user which can manipulate and access to the database.

You can name your user anything you want, and password.

Now you can copy and paste your connection string with your create user and password.

That’s it your mlab mongodb database is setup, now you can paste it to your .env file if working with node.