Quick-Start Guide to MongoLab

Step 1: Set up a MongoLab account

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.

For additional information about managing your MongoLab account users, contacts, and billing, see MongoLab Account Setup.

Step 2: Create a database subscription

After you’ve created your account, add a new database subscription. Get started quickly at no cost with a free Sandbox database.

img-newsub

For detailed steps to add a subscription, see Database Subscriptions. For a discussion on how to choose the right plan, see Plans and Data Centers.

Step 3: Connect to your new database

In a terminal window, connect to your database using the mongo shell (the command will look similar to the following example):

% mongo ds012345.mongolab.com:56789/dbname -u dbuser -p dbpassword

You can grab your connection info after logging into your account and navigating to the database’s home page:

img-connectstring

To view detailed connection instructions, troubleshooting tips, and alternate connection methods, see Connecting.

Step 4: Load some data

Here’s a quick exercise that tests an insertion into your new database:

  1. Assuming you successfully connected using the mongo shell in the previous step, run the following command:

     > db.mynewcollection.insert({ "foo" : "bar" })
  2. Next, run the command in the first line below and confirm that the shell output matches the second line (your “_id” value will be different):

     > db.mynewcollection.find()
     { "_id" : ObjectId("526705b4a3559a176784b4af"), "foo" : "bar" }

For additional instructions on how to get data, including larger datasets, into your MongoLab database, see Migrating Data into MongoLab.

Everything else you need to know

Congratulations - you’ve successfully created a MongoLab database! You’re now on your way to discovering more about MongoLab’s services so be sure to read through our documentation to get the most out of MongoLab and your MongoDB deployment(s). We have a broad range of topics that covers all the information you need to know about working with your MongoLab-managed database(s).

Our Support page also links to some great MongoDB resources that you’ll find super helpful.

Contact us

When in doubt, when you can’t find specific information, or when you’re just plain stuck, please don’t hesitate to email us directly at support@mongolab.com.