Connecting Robo 3T to MongoDB Atlas

This little tip is to help anyone struggling with connecting to MongoDB Atlas like I did.

nosql

MongoDB Atlas provides a managed MongoDB database service for various web applications. From time to time you may want to see whats happening in your database whether in your stage or production environment. There are a number of options when it comes to MongoDB clients. Some are listed below:

The first is a piece of commercial software. Since we aim to be frugal I won’t talk about it much. I do think you should give it a try. It is a great tool for database administrators. The last two are free. I started using Robo 3T in its Robomongo days when I’d just started using MongoDB so I’m more used to its interface. I used Compass a bit because that’s what Atlas suggests you use but I didn’t like the web-like interface (it felt a pit flakey).

The sad thing is that it is difficult to connect to Atlas using Robo 3T as opposed to Studio 3T and Compass. Both Compass and Studio 3T provide a feature that allows you to autofill the connection form fields using the connection link provided on Atlas. Alright enough talk let’s get down to it.

Steps

If you haven’t downloaded Robo 3T please do. Also, I’m assuming you already have a MongoDB Atlas account.

  1. Retrieve your connection link. Click the Connect button.
    connect

  2. Create a new connection. Enter your the host details in Robo 3T.
    enter host

  3. Enter your credentials.
    enter credentials

  4. Setup SSL. I didn’t need a pem cert/key in my case. All I had to do was select Self-signed Certificate.
    setup ssl

  5. Test the connection.
    test connection

A side note

I had a little issue when setting mine up. In my case, after connecting, my databases weren’t listing because of misconfigured permission. My work around here was to use the DB shell commands (since Robo 3T gives you an actually open a shell as opposed to Compass). I did the following to know my list of collections:

  • Open a new shell
    open shell
  • Run use <database-names>
  • List the collection using show collections

After that you can run any command you need. e.g.

1
db.getCollection('todos').find({status: 'done'})

Hope this saves someone sometime.

Happy Coding