# Add a MongoDB Datastore with an Existing Connection

Source: https://userguide.qualytics.io/source-datastore/datastore/native/mongodb/how-tos/add-existing-connection/

This page walks you through adding a **MongoDB** source datastore on a connection you already saved: what comes already filled in, the two sections left for you to complete, and the steps to test and finish. For what a connection is and why reusing one matters, see [Reusing a Connection](https://userguide.qualytics.io/source-datastore/datastore/connection/how-it-works/#reusing-a-connection).

Once the datastore is created, run a Sync to discover the collections in the selected database. The Sync samples each collection's documents to work out its fields; see [How fields are worked out](https://userguide.qualytics.io/source-datastore/datastore/native/mongodb/deep-dive/introduction/#how-fields-are-worked-out).

> **Tip: No connection yet?**
>
> If this is your first MongoDB datastore, create the connection first in [Add with a New Connection](https://userguide.qualytics.io/source-datastore/datastore/native/mongodb/how-tos/add-new-connection/).

> **Warning**
>
> MongoDB cannot be used as an enrichment datastore. After you add it as a source, link a separate enrichment datastore as its destination to store anomalies and metadata: either [during creation](https://userguide.qualytics.io/source-datastore/enrichment-datastore/how-tos/link-during-creation/) or [afterwards](https://userguide.qualytics.io/source-datastore/enrichment-datastore/how-tos/link-enrichment/).

## What comes already filled in

When you select a saved MongoDB connection, the **Connection Properties** and **Secrets Management** sections come already filled in and read-only. Qualytics has already validated those settings, so there is nothing to type there:

| Section | Fields | Why Read-Only |
| --- | --- | --- |
| **Connection Properties** | Connection Name, Host, Port, DNS Seed List (SRV), SSL Connection, User, Password, Auth Source | They identify the MongoDB deployment the saved connection points at and how it signs in. The password is never displayed back; the field shows only that one is stored. |
| **Secrets Management** | Vault fields, when the connection uses them | Configured once on the connection. |

> **Warning: Edits apply to every datastore on the connection**
>
> To change a saved connection's settings or password, edit the connection through [Manage Connections](https://userguide.qualytics.io/settings/connections/manage-connections/). Edits there apply to every datastore that reuses the connection, not only the one you are creating.

> **Tip: Start a new connection from this one**
>
> To use the selected connection as a starting point for a brand-new one instead, click the **Duplicate as a new connection**  button on it. The form switches to the new-connection mode with the settings already filled in for you to adjust, as described in [Add with a New Connection](https://userguide.qualytics.io/source-datastore/datastore/native/mongodb/how-tos/add-new-connection/).

## Field reference

**Location** and **General** are the only two sections left for you to fill in.

### Location

Pick the MongoDB database Qualytics should read from. Unlike **Connection Properties**, this section belongs to the datastore rather than to the connection, so it is filled in on both flows.

| Field | Required | Type | Description |
| --- | --- | --- | --- |
| **Database** | Yes | Option | One or more MongoDB databases to monitor. The dropdown is filled in from the saved connection, and lists the databases its user can see, except MongoDB's own `admin`, `config`, and `local`. Each database you pick becomes its own Qualytics datastore. |

### General

The datastore's own settings.

| Field | Required | Type | Description |
| --- | --- | --- | --- |
| **Name** | Yes | Text | The datastore name in Qualytics. Comes suggested from the connection name and the database, so you can leave it blank to accept that suggestion. |
| **Group** | No | Option | Organizes your datastores under a shared group in the navigation tree. Select an existing group, or turn on **Add New Group** to create one. |
| **Teams** | Yes | Option | Select one or more teams to associate with this source datastore. |
| **Initiate Sync** | No | Checkbox | Ask Qualytics to run the first Sync for you once the datastore is created. You can always run a Sync yourself from the datastore afterwards. |

> **Note: Selecting more than one database**
>
> When you pick several databases in **Location**, each one becomes its own datastore and **Name** is replaced by **Name Template**, a naming pattern applied to all of them. Use `{{schema}}` as the placeholder for the database name: `mongo_{{schema}}` becomes `mongo_sales`, `mongo_support`, and so on. Left empty, each datastore is named from the connection name and its database.

Below the form, an information banner lists the **Public addresses** and **Private addresses** your datastore connections originate from. Allow the ones that match your network setup through your firewall rules or, on Atlas, the project's IP access list; see [Permissions](https://userguide.qualytics.io/source-datastore/datastore/native/mongodb/deep-dive/permissions/) for the ports involved.

## Steps

**Step 1**: Navigate to the **Datastores** page.

**Step 2**: Click the **Add**  button at the top-right corner and choose **Source**  from its menu.

**Step 3**: The **Datastore** step opens, the first of two.

**Step 4**: Select **Existing Connection** next to the **Search**  field.

**Step 5**: Select the saved MongoDB connection from the grid. Use the search field to filter connections by name. The **Connection Properties** and **Secrets Management** sections come already filled in and read-only.

**Step 6**: Fill in the fields of **Location** and **General**, as described in the [Field reference](https://userguide.qualytics.io/source-datastore/datastore/native/mongodb/how-tos/add-existing-connection/#field-reference).

**Step 7**: Click **Test connection**. A success message confirms that the connection has been verified.

> **Info**
>
> The **Finish** and **Next** buttons stay disabled until the connection test passes on the current values. If the test fails, see [Troubleshooting](https://userguide.qualytics.io/source-datastore/datastore/native/mongodb/troubleshooting/).

**Step 8**: Click **Finish** to create the datastore.

> **Tip**
>
> To link an enrichment destination so Qualytics can store anomalies and metadata from the first operation, click **Next** instead of **Finish**. See [Link Enrichment on Datastore Creation](https://userguide.qualytics.io/source-datastore/enrichment-datastore/how-tos/link-during-creation/).

**Step 9**: A success dialog confirms that your datastore has been added. Click **Go to your datastore** to open its page.

*Last updated: October 28, 2026.*
