> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://fyno.io/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://fyno.io/docs/_mcp/server.

# MongoDB

> Connect MongoDB to Fyno Connect using a MongoDB connection string, validate the connection, and create cohorts from your database data.

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

#### Open MongoDB from Databases

Go to **Databases** and click **MongoDB**. The **Add a MongoDB database** pop-up opens.

#### 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](/docs/_fern-img/d37b592e01079f84103afb9677634444634dcedff41d41975e41c1c3179354cb.webp)

#### 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.

#### 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

> **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]]
> ```