If you’ve been shopping around for a MongoDB client, you may have come across the cumbersome task of manually entering connection details, or writing out a MongoDB connection string in the correct URI format.
Studio 3T makes connecting to a MongoDB database easy, which starts with how it treats connection strings or URIs.
The Standard Connection String Format
MongoDB does an excellent job of breaking down the components of the standard connection string. In summary, the standard URI format supports credential, server and database information, but it doesn’t support extra information like SSH and SSL details. Studio 3T has made it easier for users by preserving this extra information in all generated connection strings, saving you time.
How to Generate a MongoDB Connection String
You can generate complete MongoDB connection strings within Studio 3T in two ways: exporting to a MongoDB URI or to a URI file.
Export to a MongoDB URI
- Enter all connection details as you normally would under the Server, Authentication, SSL, SSH Tunnel, and Replica Sets tabs.
- Once done, go back to the Server tab and click on “To URI…“.
- Your MongoDB connection URI should be generated – simply edit the settings as needed (e.g. include passwords, SSH configuration)
- Click “Copy to clipboard“. Your MongoDB connection string is ready to be pasted and shared!
Export to a URI File
- Ensure that you are or have recently connected to a database.
- On Studio 3T, click on “Connect” and choose a Connection.
- Click on “Export” – this will open the Export Connections window.
- Choose the Connection and edit the settings as needed (e.g. include passwords, SSH configuration).
- Click “Export“- this will trigger your .uri file export.
- Choose your file destination – and done!
How to Connect with a MongoDB Connection URI
Now that you have your connection URI, our MongoDB client also makes it easy to connect to a database through two ways: copy + paste and connection URI file import.
Copy + Paste
- On Studio 3T, click on “Connect” and choose “New Connection“
- Click on “From URI…” and paste your MongoDB connection URI
Import a URI File
- Paste your connection details to a text editor and save it as a .uri file.
- On Studio 3T, click on “Connect” and choose “Import“.
- Click on “Open Connection URI File“.
- Choose your .uri file, click “Import“… and you’re in!
While these two connection methods work seamlessly on Studio 3T, other MongoDB GUIs, clients, and cloud providers only support the standard URI format. So even though your Studio 3T-generated MongoDB connection URI has all the information (e.g. SSH details, passwords), others might strip it down to the standard format and require you to enter the other details manually.