Source: https://gitlab-test-org.docs.pageloop.ai/fyno-connect-mongodb

# MongoDB

Connect your MongoDB database to Fyno Connect with a connection string. Once connected, you can build cohorts directly from the data in your database.

## Connect your MongoDB database

1. **Open MongoDB from Databases**

   Go to **Databases** and click **MongoDB**. The **Add a MongoDB database** pop-up opens.
2. **Enter the connection details**

   Fill in the following fields:
   - **Custom Name**: A name to identify this connection in Fyno Connect.
   - **MongoDB URI**: Paste your MongoDB connection string. The value is masked by default. Click the eye icon to view it.
   ![Add a MongoDB database pop-up](assets/fyno-connect-mongodb-add-database.png)
3. **Add the database**

   Click **Add Database**. Fyno tests the connection and saves it once the test succeeds. The database then appears under **Connected DBs** on the same page.
4. **Create cohorts**

   You can now create cohorts from the data in your database. See [Create Cohorts](./how-to-create-a-cohort-in-fyno-connect).

## Connection string format

> [!TIP]
>
> **Check your connection string**
>
> If the connection test fails, make sure your connection string follows the standard format:
>
> ```
> mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[database][?options]]
> ```
