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

Setup and Import the Data

Time to Complete: 8 minutes


The following items are required to complete this tutorial:

Download the Data

Download the example dataset from To download the documents, right-click on the URL and select Save Link As. This file contains the data you will import into the test.supplySales collection of your Atlas cluster in the following step.

To give an idea of the data you will visualize, here is a sample document from the dataset:

  "_id": {"$oid":"5afb2c3dc09c8d2dd5852cf2"},

Import the Data

Now that you have a file containing the documents you will be visualizing in Charts, use mongoimport to import the contents of that file into the test.supplySales collection.

mongoimport --host <myAtlasHost> --ssl -u <USER> -p <PASSWORD> --authenticationDatabase admin \
--db test --collection supplySales \
--drop --file <path/to/mgenerate-order-data.json>


Refer to the mongoimport page to familiarize yourself with the proper command syntax.

Additionally, the Atlas documentation for Connecting to a Cluster using Command Line Tools may prove helpful.

Add the Data Collection as a Data Source

Now that the data is in the desired collection, add the collection as a data source in MongoDB Charts. Adding a collection as a data source links the collection to Charts and allows us to create visualizations using that data.


Before completing this procedure, ensure that you have allowed your Atlas cluster to accept connections from MongoDB Charts.

  1. Click the Data Sources tab.

  2. Click New Data Source.

  3. In the New Data Source dialog, enter the connection string which points to the cluster containing the imported data.


    The following connection string points to an Atlas cluster called jefftestcluster and authenticates a user named admin on the admin database.


    For further instructions on determining your Atlas connection string, see the Connect Your Application Atlas documentation.

  4. Click Connect.

  5. Select the test.supplySales collection.

  6. Click Set Permissions.

  7. Select the Open Access option.

  8. Click Publish Data Source.

Next Steps

Now that you have established the data source in Charts, you can now Create a New Dashboard which will hold the visualizations.