The Connection Manager in Studio 3T makes it easy to connect to MongoDB, whether it is cloud-hosted or on-premise, or through a direct connection or a replica set.
Connect - Ctrl + N (⌘ + N)
Open Collection Tab - F10
Exit Studio 3T - Alt + X (⌘ + Q)
Create a new connection
- Open Studio 3T.
- Click on the Connect button either in the global toolbar or under the Recent Connections tab. This will open the Connection Manager.
- Click on New Connection. This will open the New Connection window.
Two ways to connect to MongoDB
Studio 3T provides two convenient ways to enter connection details: by pasting a MongoDB connection string or URI (recommended) or importing a URI file.
Use a MongoDB URI
Hosters like MongoDB Atlas, Compose, mLab, ObjectRocket, and ScaleGrid provide the MongoDB URI or connection string in an easy format, so all that’s left is to paste it within Studio 3T’s Connection Manager.
Picking up from the steps above:
- Click on the From URI button.
- Paste the connection string.
- Click OK. Studio 3T will then extract the information and automatically fill out the fields in the Server, Authentication, SSL, SSH Tunnel, and Advanced tabs. It will also automatically save the connection in the Connection Manager.
Import a URI file
To import a URI file:
- Click on the Connect button either in the global toolbar or under the Recent Connections tab.
- Then, click on the Import button.
- Click on Open Connection URI File.
- Choose your .uri file and click Import.
Configure your MongoDB connection
You can configure your MongoDB connection settings further under the Server, Authentication, SSL, SSH Tunnel, Proxy, and Advanced tabs.
- Enter Connection Name – Name your connection.
- Add Custom Color – Color-code your connection (e.g. to avoid production and test database mixups).
- Choose Connection Type – Choose from Direct Connection, or Replica Set or Sharded Cluster.
Enter Server Details – Enter server hostnames or IP addresses and port details.
- Enable/Disable Read Only Lock – Enables/disables read-only mode for the results shown in the connection you’re about to set up.
- From URI – Import or paste the MongoDB connection string or URI (e.g. from your MongoDB hosting provider) here.
To URI – Export your connection details to a MongoDB URI, with the option to include passwords and add a replica set option.
- Test Connection – Test connection details before saving. This button is accessible across all tabs.
Studio 3T supports these authentication methods:
- Basic (SCRAM-SHA-256)
- Legacy (SCRAM-SHA-1)
- Kerberos (GSSAPI) – Enterprise only
- LDAP (Plain) – Enterprise only
Basic and Legacy authentication cover most cases.
- Authentication Mode – Choose your authentication mode.
- User Name – Enter your user name.
Password – Enter your password.
- Authentication DB – Enter the database where the user is defined.
- Manually list visible databases – In most cases, Studio 3T will automatically list the databases that should be visible to non-admin uses. In some cases when this information isn’t available, you can check the box and manually specify them here.
- Check the Use SSL protocol to connect box to connect over SSL. From here, you can choose to…
- Accept any server SSL certificates – This normally covers most use cases.
- Use own Root CA file – Locate the –sslCAFile on your machine.
- Accept server SSL certificates trusted by the operating system
- Use client certificate – Enter your client certificate and passphrase.
- Allow invalid hostnames – Disables the validation of hostnames in TSL/SSL certificates.
- Use Server Name Indication (Advanced) – Some servers may require the client to specify the server name it’s trying to connect to. If so, fill out this field so that the server can present one of the many SSL certificates.
Check the Use SSH tunnel to connect box if applicable and fill out the fields:
- SSH Address
- SSH User Name
- SSH Auth Mode
- SSH Password – Note that passwords are encrypted for storage. If you don’t want to store your password, leave the field blank and you’ll be prompted to enter it later.
You can use Studio 3T to connect using:
- Application default proxy
- Custom proxy (HTTP and SOCKS) – These HTTP and SOCKS custom proxy settings are available when connecting to MongoDB databases, connecting to SQL databases for import, and for application-run HTTPS requests (e.g. Telemetry).
- Direct/no proxy
You can also configure advanced settings like:
- Max connection idle time (in ms) – Sets the maximum idle time in milliseconds for a connection. In some cases, the connection could be dropped by a firewall or a load balance. Here’s a little tip to prevent a connection timeout. Default value of “0” means unlimited idle time.
- Server selection timeout (in ms) – Defines how long Studio 3T will wait for server selection to succeed before throwing an exception.Default value is 30000. A value of 0 means it will time out immediately if no server is available. A negative value means it will wait indefinitely.
- Socket timeout (in ms) – Sets the socket timeout in milliseconds. It is used for I/O socket read and write operations. Default value is “0” and means no timeout.
- Connect timeout (in ms) – Sets the connection timeout in milliseconds, used solely when establishing a new connection. A value of “0” means no timeout. Default value is 10000.