This little tip is to help anyone struggling with connecting to MongoDB Atlas like I did.
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.
If you haven’t downloaded Robo 3T please do. Also, I’m assuming you already have a MongoDB Atlas account.
Retrieve your connection link. Click the Connect button.
Create a new connection. Enter your the host details in Robo 3T.
Enter your credentials.
Setup SSL. I didn’t need a pem cert/key in my case. All I had to do was select
Test the connection.
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
- List the collection using
After that you can run any command you need. e.g.
Hope this saves someone sometime.