Navigation
This documentation refers to the on-premises edition of MongoDB Charts. Read the Atlas service documentation to learn how to use MongoDB Charts with your Atlas project.

Data Sources

Data sources in MongoDB Charts reference a collection or view in your MongoDB deployment. When building a chart, you will need to specify the data source that the chart uses.

To view, add, or remove data sources, click Data Sources on the top navigation bar.

Data Sources List

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
Column Description
Name 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.
Collection & Deployment

Contains two pieces of information for the data source:

  • Database and collection from which Charts retrieves data for this data source.
  • Hostname of the MongoDB deployment which contains the collection.
Applied Aggregations

Aggregation stages applied to this data source. Data source Owners can define an 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.

Created When the data source was created.
Permissions

The icon next to the Access button denotes the permissions 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 Manage Existing Data Sources.

Note

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

Filter Data Sources

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.

Add a Data Source

Considerations

MongoDB Charts requires that MongoDB deployments run version 3.4 or later.

If your MongoDB deployment is running with authentication enabled, include a database user’s credentials in the connection string URI. Anonymous, SCRAM, and LDAP authentication mechanisms are supported. The database user must have read permissions on the collections selected in the following step.

If the authenticated user does not have the listDatabases privilege on the deployment specified in the URI, they can still add the data source by specifying the desired database as part of the URI. In this case, the URI takes the following form:

mongodb://[username:password@]<server>:<port>/<database>

If your deployment is running with TLS/SSL enabled, add the ssl=true option to the URI:

mongodb://[username:password@]<server>:<port>/<database>?ssl=true

For more information, see Connect to a TLS/SSL-Enabled Data Source.

Procedure

  1. From the Data Sources list, click the New Data Source button.

  2. Enter the Connection String URI of the MongoDB deployment to which you want to connect.

  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.

  5. Click Set Permissions.

  6. Set the permissions for the data source. You can search for specific users by name or email address using the search bar.

  7. Click Publish Data Source.

    Note

    If you selected multiple collections for your data source in step 4, the data source permissions you select are applied to all of the selected collections when you publish your data source. If you wish to apply different permissions to individual collections that you have selected, you will need to edit those data sources after publishing.

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