Docs Menu

Data Sources

On this page

  • Data Sources View
  • Add a Data Source
  • Sample Data Source
  • Data Source Read Preference

Data sources in MongoDB Charts reference a collection or view in your MongoDB deployment. You can use the fields in that collection or view to construct a chart. When you build a chart, you must specify the data source that the chart uses.

To view, add, or remove data sources, click Data Sources in the sidebar.

The Data Sources list displays existing data sources for which the currently logged-in user has Author or Owner permissions. The data sources are displayed in a tabular format with the following columns:

Diagram of the "Data Sources" list
Name of the data source. By default, this is the data source's corresponding database and collection name. To learn how to rename a data source, see Rename a Data Source.

Contains two pieces of information for the data source:

  • Database and collection from which Charts retrieves data for this data source.
  • Name of the Atlas cluster or Atlas Data Lake that contains the collection.
When the data source was created.

Aggregation stages applied to this data source. Data source Owners can define one aggregation pipeline to pre-process data before it reaches the chart builder.

For more information on defining aggregation pipelines for a data source, see Data Source Pipelines.


The icon next to the Access button denotes the permission you have on the data source. For details on the various data source permissions, see Data Source Permissions.

To modify the permissions for a data source, see the Modify a Data Source section.


You can sort data sources by any of the columns by clicking on the column header.

To search for specific data sources, use the search bar at the upper right corner of the Data Sources list. You can search by Deployment, Database, Collection, or Alias.

Additionally, you can use the dropdown to the left of the search bar to show either all data sources on your MongoDB Charts deployment, or only data sources for which you have the Owner permission. For more information on data source permissions, see Data Source Permissions.

  1. From the Data Sources list, click the Add Data Source button.
  2. Select one of the Atlas clusters or Atlas Data Lakes.

    Atlas displays:

    • All clusters in the current project for which the current user has the Project Data Access Read Only role or higher.
    • All Data Lakes in the current project.
  3. Click Connect.
  4. Select the collections from which you wish to create data sources. Charts creates a separate data source for each selected collection.

    Select or expand a database to display the number of documents in and the size of each collection it contains.

    Collection size statistics shown on the Add Data Source modal
  5. Click Finish.

Charts grants the default permissions to each data source. To set the permissions for a data source, see Modify Data Source Permissions.

You will see your newly added data source listed in the Data Sources list. To learn how to manage existing data sources, see Manage Existing Data Sources.

The Sample Data: Movies data source is automatically included in all Charts tenants and provides sample movie data to explore MongoDB Charts. The Sample Dashboard uses this data source to show the possible charts you can create. You can access the sample data source from all dashboards. You do not have permissions to the sample data source, meaning you can not add, edit, or delete the data it contains


You cannot remove or edit the sample data source. You also cannot externally share or embed charts that use the sample data.

Each data source has a read preference which determines the replica set member that the data source reads data from.

By default, a newly added Atlas cluster data source has a read preference of Secondary, meaning that it reads from a secondary node within the Atlas cluster. If another data source also reads from the same Atlas cluster as the newly created data source, the newly created data source has the same read preference as the existing data source.

You can change the read preference of a data source in the Data Sources list only if the data source is an Atlas cluster. You cannot change the read preference of a data source if the data source is your Data Lake.

←  Interact with Charts on a DashboardManage Existing Data Sources →
Give Feedback
© 2022 MongoDB, Inc.


  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.