MongoDB in the Cloud

MongoDB in the Cloud

by John Vincent

Posted on April 16, 2017

Setup a MongoDB Database at mLab

Setting up a MongoDB Database is straightforward.

Getting Started

Get an account at mLab if you do not already have one.

Using mLab

Sign in to mLab

  1. MongoDB Deployments

    • Create New
  2. Single-node (free)

    • Sandbox (free)
    • Note MongoDB version
  3. Database Name: jv-test-1

  4. Click Create new MongoDB deployment

Create a User

  • Select Database
  • Users Tab
  • Click Add database user
  • Create User, user = jvtest
To connect using the mongo shell:
mongo -u <dbuser> -p <dbpassword>

To connect using a driver via the standard MongoDB URI (what's this?):
mongoimport --db jv-test-1 --collection restaurants --drop --file primer-dataset.json --host --port 17348  -u jvtest -p <password>
  • Connect to the database
mongo -u jvtest -p <password>
  • Verify data
use jv-test-1