> This page location: /docs.md > /docs/development.md > /docs/charts.md > /docs/charts/data-sources.md

> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

<!--
Tab options on this page. Append to the .md URL to filter:
  ?tabs=<id,...>   select specific tabs (e.g. ?tabs=nodejs,shell)
  ?allTabs=true    include every tab
  (no param)       default: one tab per tabset

Available tabs:
  other tabs: disconnect-data-source, disconnect-database
-->

# Manage Data Sources

On the Data Sources page, an Atlas [`Project Owner`](https://docs.atlas.mongodb.com/reference/user-roles/#mongodb-authrole-Project-Owner) can:

- [Connect a data source](https://www.mongodb.com/docs/charts/manage-data-sources.md#std-label-connect-data-source) to Atlas Charts.

- [Disconnect a data source or database](https://www.mongodb.com/docs/charts/manage-data-sources.md#std-label-disconnect-data-source) from Atlas Charts.

- Modify [data source settings.](https://www.mongodb.com/docs/charts/manage-data-sources.md#std-label-access-data-source-settings-page)

**Note:**

If you want to combine two or more data sources, you must create an Atlas Data Federation.

## Connect a Data Source to Charts

Connect to a specific data source to Charts to use its data in your charts.

When you connect a data source, Charts grants the default [permissions](https://www.mongodb.com/docs/charts/manage-data-sources.md#std-label-permission-model) to Charts users. To customize the permissions for a data source, see [Modify Data Source Permissions.](https://www.mongodb.com/docs/charts/manage-data-sources.md#std-label-mod-data-source-permissions)

Charts connects to all deployments and data sources by default. To learn about data sources and deployments, see [Data Sources](https://www.mongodb.com/docs/charts/data-sources.md#std-label-data-sources). To learn how to connect or disconnect a deployment, see [Manage Deployments.](https://www.mongodb.com/docs/charts/manage-deployment.md#std-label-manage-deployment)

To connect a data source to Charts:

1. Connect your deployment.

   To learn more, see [Connect a Deployment to Charts.](https://www.mongodb.com/docs/charts/manage-deployment.md#std-label-connect-deployment)

2. In the Data Access section, select the database that contains the data source.

   Select the database that contains the data source you want to connect. The database's data sources display, including [charts views.](https://www.mongodb.com/docs/charts/create-manage-charts-view.md#std-label-charts-views)

   If the database is disconnected:

   Click the Connect button next to the database.

   In the Reconnect Database dialog box, click Reconnect.

   Charts displays the following information about the data source:

   | Column | Description |
   | --- | --- |
   | Data Source | Human-readable label that identifies the data source and its chart views. |
   | Organization | Label that indicates whether you've enabled [organization-wide sharing.](https://www.mongodb.com/docs/charts/manage-data-sources.md#std-label-org-sharing-data-source) |
   | External Users | Label that indicates whether: You enabled external user access.; The external user connection method is Authenticated or Unauthenticated. |
   | Status | Label that indicates whether you connected the data source to Atlas Charts. |

3. Click Manage next to the data source's information.

   The data source's details page displays the following information:

   | Field | Description |
   | --- | --- |
   | Data Source Name | Human-readable label that identifies the data source in Atlas. |
   | Data Source Connection Status | Label that indicates whether you connected the data source to Atlas Charts. |

   To learn more about the other information that displays on the data source's details page, see [Manage Data Sources.](https://www.mongodb.com/docs/charts/manage-data-sources.md#std-label-manage-existing-data-sources)

4. Check the connection status and connect the data source.

   If the data source connection status is Connected, you already connected this data source to Atlas Charts. The Data Access section displays.

   If the data source connection status is Disconnected:

   Click the connect icon  next to the data source connection status.

   Click Reconnect on the modal that displays.

   The data source connects and the Data Access section displays.

   To learn more about the other information that displays in the data source's Data Access section, see [Manage Data Sources.](https://www.mongodb.com/docs/charts/manage-data-sources.md#std-label-manage-existing-data-sources)

## Disconnect a Data Source or Database from Atlas Charts

Disconnect a data source or database from Charts to remove its data from your charts. If you disconnect a data source:

- Any charts you built that use the data source no longer render and display an error.

- Any charts that use [`$lookup`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/lookup.md#mongodb-pipeline-pipe.-lookup) to access data in the data source no longer render and display an error.

- You can't use the data source to build new charts.

If you disconnect a database, Charts disconnects all of the data sources in the database. You can [reconnect](https://www.mongodb.com/docs/charts/manage-data-sources.md#std-label-connect-data-source) a data source or database later to resume rendering charts that use its data.

You can also [disconnect a deployment](https://www.mongodb.com/docs/charts/manage-deployment.md#std-label-disconnect-deployment). To delete a charts view, see [Create and Manage Charts Views.](https://www.mongodb.com/docs/charts/create-manage-charts-view.md#std-label-charts-views)

**Note:**

Charts automatically includes the Sample Data: Movies data source in all Charts tenants. The [Sample Dashboard](https://www.mongodb.com/docs/charts/dashboards.md#std-label-sample-dashboard) uses this data source to show the charts you can create. You can access the sample data source from all dashboards.

You can't:

- Add, edit, or delete the data in the Sample Data: Movies data source.

- Remove the sample data source.

- Externally share or [embed](https://www.mongodb.com/docs/charts/embedding-charts.md#std-label-embedding-charts) charts that use the sample data.

To disconnect a data source or database from Charts:

### Disconnect Data Source

1. Go to the Data Sources page.

   Click Data sources under the Settings heading in the sidebar.

   The [Data Sources](https://cloud.mongodb.com/go?l=https%3A%2F%2Fcharts.mongodb.com%2F%3Cchart-app-id%3E%2Fdata-sources) page displays.

2. In the Deployment dropdown, select the deployment that contains your data source.

   Deployments in Atlas Charts reference Atlas deployments that contain valid Charts data sources, including:

   - All [clusters](https://www.mongodb.com/docs/atlas/create-database-deployment/) in your Atlas project for which you have the [`Project Data Access Read Only`](https://docs.atlas.mongodb.com/reference/user-roles/#mongodb-authrole-Project-Data-Access-Read-Only) role or higher.

   - All [federated database instances](https://www.mongodb.com/docs/atlas/data-federation/) in your project, including [Online Archives.](https://www.mongodb.com/docs/atlas/online-archive/manage-online-archive/)

   After you select a deployment, the following information displays:

   | Field | Description |
   | --- | --- |
   | Deployment Name | Human-readable label that identifies the deployment in Atlas. |
   | Deployment Connection Status | Label that indicates whether you connected the deployment to Atlas Charts. |
   | Type | Label that identifies the deployment as a replica set, or federated database instance. |
   | Status | Label that indicates the current operating condition of the deployment. |
   | Version | Label that indicates the MongoDB version on which the deployment runs. Charts doesn't display Version for federated database instances. |
   | Region | Label that indicates the cloud provider and region where MongoDB provisions the deployment. |
   | Tier | Label that indicates the Atlas [cluster tier](https://docs.atlas.mongodb.com/manage-clusters/#std-label-create-cluster-instance) for the deployment. |

3. In the Data Access section, select the database that contains the data source.

   Select the database that contains the data source you want to disconnect. The database's data sources display.

4. Click Manage next to the data source's information.

   The data source's details page displays.

5. Check the connection status and disconnect the data source.

   If the data source connection status is Disconnected, the data source is already disconnected from Atlas Charts.

   If the data source connection status is Connected:

   Click the disconnect icon  next to the data source connection status. The Disconnect Data Source modal appears.

   Click Check for connected charts to learn whether any charts use the data source.

   Click Disconnect.

   The data source disconnects from Charts.

## Access Data Source Settings

To access the data source's settings page:

1. Go to the Data Sources page.

   Click Data sources under the Settings heading in the sidebar.

   The [Data Sources](https://cloud.mongodb.com/go?l=https%3A%2F%2Fcharts.mongodb.com%2F%3Cchart-app-id%3E%2Fdata-sources) page displays.

2. In the Deployment dropdown, select the deployment that contains your data source.

   Deployments in Atlas Charts reference Atlas deployments that contain valid Charts data sources, including:

   - All [clusters](https://www.mongodb.com/docs/atlas/create-database-deployment/) in your Atlas project for which you have the [`Project Data Access Read Only`](https://docs.atlas.mongodb.com/reference/user-roles/#mongodb-authrole-Project-Data-Access-Read-Only) role or higher.

   - All [federated database instances](https://www.mongodb.com/docs/atlas/data-federation/) in your project, including [Online Archives.](https://www.mongodb.com/docs/atlas/online-archive/manage-online-archive/)

   After you select a deployment, the following information displays:

   | Field | Description |
   | --- | --- |
   | Deployment Name | Human-readable label that identifies the deployment in Atlas. |
   | Deployment Connection Status | Label that indicates whether you connected the deployment to Atlas Charts. |
   | Type | Label that identifies the deployment as a replica set, or federated database instance. |
   | Status | Label that indicates the current operating condition of the deployment. |
   | Version | Label that indicates the MongoDB version on which the deployment runs. Charts doesn't display Version for federated database instances. |
   | Region | Label that indicates the cloud provider and region where MongoDB provisions the deployment. |
   | Tier | Label that indicates the Atlas [cluster tier](https://docs.atlas.mongodb.com/manage-clusters/#std-label-create-cluster-instance) for the deployment. |

3. In the Data Access section, under Deployment, click the name of the database that contains the data source.

   A list of the database's data sources appears.

4. Click Manage next to the data source's information.

   The data source's details page displays.

5. Check the connection status and connect the data source.

   If the data source connection status is Connected, you already connected this data source to Atlas Charts. The Data Access section displays.

   If the data source connection status is Disconnected:

   Click the connect icon  next to the data source connection status.

   Click Reconnect on the modal that displays.

   The data source connects and the Data Access section displays.

## Modify Data Source Permissions

If you have the [`Project Owner`](https://docs.atlas.mongodb.com/reference/user-roles/#mongodb-authrole-Project-Owner) role, you can control who can see charts that use the data source.

### Enable Organization-Wide Sharing for a Data Source

Organization-wide sharing grants users in your organization, including users who are not members of your project, permission to view data in a deployment that is used for dashboards shared with your organization.

You can enable organization-wide sharing [for an entire deployment](https://www.mongodb.com/docs/charts/manage-deployment.md#std-label-org-sharing-deployment) or [for a specific data source.](https://www.mongodb.com/docs/charts/manage-data-sources.md#std-label-org-sharing-data-source)

To enable organization-wide sharing for a specific data source:

1. Access the data source's settings page.

   To learn more, see [Access Data Source Settings.](https://www.mongodb.com/docs/charts/manage-data-sources.md#std-label-access-data-source-settings-page)

2. Turn on organization-wide sharing.

   In the Organization subsection of the Data Access section, toggle All users in the organization can view data in this data source to ON.

### Enable External Sharing for a Data Source

External sharing grants others the ability to either:

- [Embed charts](https://www.mongodb.com/docs/charts/embedding-charts.md#std-label-embedding-charts) to use the data source in external web pages.

- View charts when given a link to that chart.

To share a chart externally via embed or link, you must enable external sharing both on the data source and the individual chart.

Charts disables external sharing by default for all data sources.

To enable external sharing for a data source:

1. Access the data source's settings page.

   To learn more, see [Access Data Source Settings.](https://www.mongodb.com/docs/charts/manage-data-sources.md#std-label-access-data-source-settings-page)

2. Turn on external sharing.

   In the External Users subsection of the Data Access section, toggle External users can view data in this data source to ON.

3. Select your authentication settings.

   Select either:

   Allow authenticated external data access.

   Any chart that uses this data source requires authentication through an SSO (Single Sign-On) provider for external viewing. Authentication providers add an extra layer of security to your data.

   To learn how to configure an embedding authentication provider, see [Configure Embedding Authentication Providers.](https://www.mongodb.com/docs/charts/configure-auth-providers.md#std-label-configure-auth-providers)

   Users can view charts that use this data source on dashboards when they are logged into Atlas Charts. They can't view the charts on dashboards shared via a public link.

   Allow unauthenticated external data access.

   Any chart that uses this data source does **not** require authentication for external viewing. Though less difficult to implement, allowing unauthenticated external data access is less secure. Use this option only for charts that display non-sensitive data.

   - Embedded charts can render using both unauthenticated and authenticated requests.

   - Any charts using this data source can be viewed on [dashboards shared via a link.](https://www.mongodb.com/docs/charts/dashboards/dashboard-access/dashboard-permissions.md#std-label-dashboard-access-link)

After you enable external sharing for a data source, you can enable external sharing for individual charts that use that data source.

**Note:**

If you turn off external sharing for a data source, all charts which use that data source stop rendering immediately.

### Disable External Sharing for a Data Source

To disable external sharing for a data source:

1. Access the data source's settings page.

   To learn more, see [Access Data Source Settings.](https://www.mongodb.com/docs/charts/manage-data-sources.md#std-label-access-data-source-settings-page)

2. Turn off external sharing.

   In the External Users subsection of the Data Access section, toggle External users can view data in this data source to OFF.

### Modify Role Permissions for Data Sources

If you have the [`Project Owner`](https://docs.atlas.mongodb.com/reference/user-roles/#mongodb-authrole-Project-Owner) role, you can modify data source permissions for Non-Data roles. Data source permissions determine whether a user can view charts created using data in this data source.

**Note:**

Charts automatically assigns project roles to users based on their Atlas [user role.](https://www.mongodb.com/docs/atlas/reference/user-roles/)

To modify permissions for Non-Data project roles:

1. Access the data source's settings page.

   To learn more, see [Access Data Source Settings.](https://www.mongodb.com/docs/charts/manage-data-sources.md#std-label-access-data-source-settings-page)

2. Change the data source permissions for Non-Data roles.

   You can select or clear the Can view charts with data in this data source option to allow Non-Data roles to view charts for the data source:

   Hover over a project role to learn which [Atlas user roles](https://www.mongodb.com/docs/atlas/reference/user-roles/) correspond to that project role.

   Charts already authorizes data source permissions to view and create charts for [`Project Owner`](https://docs.atlas.mongodb.com/reference/user-roles/#mongodb-authrole-Project-Owner), and Data roles.

### Modify Data Source Read Preference

To modify a data source's read preference, you must modify the read preference for its deployment. To learn more, see [Manage Deployments.](https://www.mongodb.com/docs/charts/manage-deployment.md#std-label-manage-deployment)

## Modify Data Source Pipeline

You can modify a chart view's pipeline by [accessing the data source's settings page](https://www.mongodb.com/docs/charts/manage-data-sources.md#std-label-access-data-source-settings-page) and clicking the Pipeline tab. To learn more, see [Create and Manage Charts Views.](https://www.mongodb.com/docs/charts/create-manage-charts-view.md#std-label-data-sources-pipeline)

The Pipeline is dimmed for collections. To create a pipeline based on a collection, [create a charts view.](https://www.mongodb.com/docs/charts/create-manage-charts-view.md#std-label-charts-views)
