In this tutorial, we’ll show you how to connect to your Compose-hosted MongoDB database with Studio 3T.
Prerequisites:
- Sign up for a Compose account through their free 30-day trial.
- Download our MongoDB GUI on your Windows, Mac, or Linux machine.
Connect to Compose
- Log into your Compose account.
- You’ll land on an overview of your Compose-hosted deployments (e.g. MongoDB, Redis, Elasticsearch). Choose your MongoDB deployment.
![Choose your MongoDB deployment on Compose](https://studio3t.com/wp-content/uploads/2017/11/connect-to-compose-mongodb-deployment-1024x214.png)
3. You’ll then see your Deployment Overview. Scroll down to Connection Info – this is where you’ll find the connection string to enter in Studio 3T.
4. Copy the connection string. Note that you’ll need to edit certain placeholder texts (e.g. admin, password) but this can be done later.
![The Connection Info section on Compose's Deployment Overview page will show you the connection string needed to connect to Studio 3T](https://studio3t.com/wp-content/uploads/2017/11/connection-info-on-compose-io-1024x266.png)
Connect to Studio 3T
Use your MongoDB connection string
- Open Studio 3T and click on Connect.
- Choose New Connection.
- Click on From URI – this will open up the Import URI window.
- Paste the connection string from Compose and click OK.
![Steps on how to connect to your Compose.io-hosted MongoDB database via Studio 3T](https://studio3t.com/wp-content/uploads/2017/11/compose-mongodb-connection-string-on-studio-3t-1024x856.png)
Configure connection details
Now it’s time to modify the placeholder texts.
- Click on the Authentication tab to modify your username and password.
- Enter a name for the connection.
- Click Save – this will store your connection details in the Connection Manager.
![Edit your Compose.io connection details in the Authentication tab](https://studio3t.com/wp-content/uploads/2017/11/authentication-details-compose-hosted-instance-907x1024.png)
4. Click Connect.
![Your Compose.io connection will be saved automatically In Studio 3T](https://studio3t.com/wp-content/uploads/2017/11/compose-connection-on-studio-3t-1024x791.png)
Add a MongoDB user
If you’re logged into Studio 3T as a user with admin rights, then you can add users directly in our MongoDB GUI without having to do it through Compose’s web interface.
- Click on the Users tab, or right-click on your target database and click Manage Users.
![Add MongoDB users to your Compose-hosted database directly in Studio 3T](https://studio3t.com/wp-content/uploads/2017/11/add-mongodb-users-studio-3t-1024x883.png)
2. Follow steps 2-4 on how to add a new user and grant roles.
Add a MongoDB database
Similar to creating a user, you can also add a database directly to your Compose-hosted MongoDB deployment within Studio 3T. Right-click on a server, click Add Database, give it a name, and done.
![Adding a database on Studio 3T](https://studio3t.com/wp-content/uploads/2017/09/add-database-studio-3t.png)