# MongoDB

You can connect to your MongoDB database to explore data, combine them with other data sources and build apps on top of them as a data foundation.

## Connecting to your MongoDB Database

To connect your MongoDB database, follow the steps below:

1. Go to **Data Management** and click on "**New source**" to create a new data source.&#x20;
2. Select **MongoDB** from the list of available data sources.
3. Name your data source connection and provide the connection details:

<table><thead><tr><th width="201">Setting</th><th>Description</th></tr></thead><tbody><tr><td><strong>Hosts</strong></td><td>The host url of the MongoDB instance that stores your database. </td></tr><tr><td><strong>(optional) Use DNS seed list</strong></td><td>You can specify if you want to use DNS entries to provide a seed list for the initial discovery of the replica set configuration. For <a href="https://www.mongodb.com/docs/manual/reference/connection-string/#std-label-connections-dns-seedlist">more info</a>.</td></tr><tr><td><strong>(optional) Use Replica set</strong></td><td><p>You can specify if you want to connect to a MongoDB server that stores a replice of your data. </p><ul><li>Replica set: The host url of your replica server.</li></ul></td></tr><tr><td><strong>Database name</strong></td><td>Name of the database that holds the collections that you want to access.</td></tr><tr><td><strong>Username &#x26; Password</strong></td><td>These are the credentials of the user account that has the required access permissions for (parts of) the database.</td></tr><tr><td><strong>Connect using SSL</strong></td><td>You can specify if you want to connect to the server using SSL. This is a default setting to ensure secure connection.</td></tr><tr><td><strong>(optional) Use SSH tunnel</strong></td><td><p>Specifies if the connection should run via SSH tunnelling. If you are familiar with SSH tunnelling, you will need to provide the following additional details. Once this option is toggled, we provide our public key for download.</p><ul><li>Bastian host</li><li>Bastian port</li><li>SSH user</li></ul></td></tr></tbody></table>

4. Click on "**Test connection"** to ensure that your connection works reliably and save your data source connection with "**Connect**".

Note: You can configure the data source for two different environments, Staging and Production. You can find more information about it [here](broken://pages/FM88Izx8RDNtGtuF6cvH).&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.uify.io/integrations/mongodb.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
