Getting Started with mLab and Studio 3T

Studio 3T + mLab

mLab is the leading Database-as-a-Service for MongoDB, powering over half a million deployments worldwide. Trusted by companies such as Lyft, Facebook, and Whole Foods. Studio 3T is a graphical user interface and IDE for MongoDB. Among other things, it allows you to explore your data in a more intuitive way and simplifies complex queries through its query tools.

In this post you will learn

  • how to setup a cluster with mLab
  • how to connect your mLab database to Studio 3T
  • where to go to learn more about working with Studio 3T

Set up a Cloud Cluster

This section will guide you through setting up a free Sandbox. A free Sandbox deployment which offers a single node with 500 MB of storage.

  1. Click on Create New in the MongoDB Deployments section of your home screen.
  2. Select a cloud provider and the free Sandbox plan type. Then click on the Continue button.
  3. Select the region that is closest to you. Then click on the Continue button.
    Note: For production environments your application and your database should be co-located.
  4. Enter a name for your database. Then click on the Continue button.
  5. After reviewing your selections click on Submit Order.

The database will take a few seconds to be ready.

Screencast of a user creating a deployment on mLab.

Obtain the Connection URI

On your mLab home screen, click on the database you want to connect to (if you have a cluster, you will have to first click on the cluster, and then select the database). At the top of the screen of your database you will see a URI of the form mongodb://<dbuser>:<dbpassword>@ds012345.mlab.com:12345/database-name or mongodb://<dbuser>:<dbpassword>@ds012345-a0.mlab.com:12345,ds112345-a1.mlab.com:12345/<dbname>?replicaSet=rs-ds112345. You need a username and password to replace the placeholders <dbuser> and <dbpassword> within this the string.

To create a user, click on the 'Users' tab and click the 'Add database user' button. Do not select the 'Make read-only' option as you need a user that can write to the database.

Screencast of a user creating a user for a database on mLab.

Connect to Studio 3T

If you haven't yet go ahead and download Studio 3t and install it. You will need the connection URI string from your database in the following steps. It should be of the form mongodb://<dbuser>:<dbpassword>@ds012345.mlab.com:12345/database-name.

  1. Inside Studio 3T, click on Connect in the top left corner of the toolbar.
  2. Inside the Connection Manager that opens up, click on New Connection in the top left corner of the toolbar.
  3. Inside the new connection window that opens, give your connection a name. Then click on From URI... in the bottom of the window.
  4. Paste your connection URI (ensure you replace the placeholders with your username and password) and click on Ok.
  5. To confirm Studio 3T extracted everything correctly, you can verify the information in the Server, Authentication, and SSL tabs. Once you are satisfied click Save.
  6. Lastly, select the connection you just created and connect to it.

Screencast of a user connecting to their mLab deployment from Studio 3T.

Exploring Studio 3T

Now that you are all set up, let's insert an example dataset:

  1. Either Copy the dataset into your clipboard or save it as a file.
  2. Inside Studio 3T, select your database and click on Import and import the JSON dataset either from your clipboard or by selecting the file you saved. If you copied the data from your clipboard be sure to add pokemon as the name of your collection.
  3. Click on Next twice and then on Start Import.

Screencast of a user importing a dataset into a database in Studio 3T.


You now have a sample dataset and you'll find your new collection located on the left hand side within the Connection Pane. Double-click your new collection and you'll see the Collection Tab open up with all your collection's documents. From here you can use the UI to add, edit, view, and delete documents. You also have access to the Visual Query Builder from here.  

To explore Studio 3T's functionality further have a look at the three different ways to view your data or how to build complex queries using drag & drop fields. Our other favorites include the IntelliShell that offers auto-completion as you type and the SQL query tool.

Learn more

If you're interested in hearing about other tutorials and MongoDB tips, follow us on Twitter @mlab. Also, if you could use help with an mLab-hosted database, you can always contact support@mlab.com.

Naomi Pentrel is a Developer Advocate at mLab and a full-stack pythonista with a focus on improving developer workflows. She has previously worked at companies such as Google, Microsoft, and Bloomberg. When not at work or a organizing Smooth DevOps, Naomi is an avid Pokémon master and a slayer of houseplants.

About Naomi Pentrel

Naomi Pentrel is a Developer Advocate at mLab and a full-stack pythonista with a focus on improving developer workflows. She has previously worked at companies such as Google, Microsoft, and Bloomberg. When not at work or a organizing Smooth DevOps, Naomi is an avid Pokémon master and a slayer of houseplants.

, ,