In this tutorial I will explain you how to setup mongoDB in mongoLab. To get started with MongoLab, you must first create your free MongoLab account. When that’s complete, you can add as many database subscriptions as you want. Login to your account and you will see a button on the right hand side of of mongoDB deployment. Click on the create new button and you will be redirected data subscription page.
For installation of mongoDB read this tutorial
Select the cloud provider of your choice. I am selecting here google cloud. Give the name of database and click on the Create mongoDB deployment.
Get started quickly at no cost with a free Sandbox database.
Once you are done. Now you can create a database, which you then connect to and use via your local shell. While logged into your account, click on the “Add” button to create a database:
Fill the required field and save the details.
Note: To connect to your MongoLab account, you will need MongoDB running on your own machine. Once you have it running, you can then connect to your MongoDB instance on your MongoLab account.
Once you have started the mongoDB on local host then open your MongoLab account in your web browser. You will see the database name you have created click on the database name to see the information you need at the top of the database window in the web admin area:
Shell access method is the easiest way to connect. You can create a user for your database in the web admin area, by clicking on the users tab:
Click on the add database user button.
Once the username and password is set. You can use to connect to the localhost with the mongoLab database. Now you can click create collection in the database and add document to the database. You will see this screen after user created.
Now clickon the create collection button to create collection.
Hope this tutorial How to setup mongoDB in mongoLab will help you. Feel free to ask any question.
Read this tutorial for installation How to install up MongoDB and PHP on Ubuntu