This documentation refers to the MongoDB Charts beta service in MongoDB Atlas. Read the on-premises documentation to learn how to use the MongoDB Charts beta on site.

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.

  1. Launch Charts from the Atlas cluster which contains your imported data.

  2. Click the Data Sources tab.

  3. Click New Data Source.

  4. In the New Data Source dialog, select the Atlas Project which contains your imported data.

  5. Click Connect.

  6. Select the test.supplySales collection.

  7. Click Set Permissions.

  8. Leave these options as default and click Publish Data Source.


    For details on data source permissions, see the Data Source Permissions page.

Next Steps

Now that you have established the data source in Charts, you can Create a New Dashboard which will use this data source to create visualizations.