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

Estimated Time to Complete: 10 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.movieDetails collection of your Atlas cluster in the following step.

The movieDetails.json file is 1.4 MB and contains records for 2250 movies. The following is a sample document from the dataset:

     "_id" : ObjectId("5b107bec1d2952d0da904dd7"),
     "title" : "Titan A.E.",
     "year" : 2000,
     "rated" : "PG",
     "runtime" : 94,
     "countries" : [
     "genres" : [
     "director" : "Don Bluth, Gary Goldman, Art Vitello",
     "writers" : [
             "Hans Bauer",
             "Randall McCormick",
             "Ben Edlund",
             "John August",
             "Joss Whedon"
     "actors" : [
             "Matt Damon",
             "Bill Pullman",
             "John Leguizamo",
             "Nathan Lane"
     "plot" : "A young man learns that he has to find a hidden Earth ship before an enemy alien species does in order to secure the survival of humanity.",
     "poster" : "",
     "imdb" : {
             "id" : "tt0120913",
             "rating" : 6.6,
             "votes" : 50875
     "tomato" : {
             "meter" : 52,
             "image" : "rotten",
             "rating" : 5.7,
             "reviews" : 99,
             "fresh" : 51,
             "consensus" : "Great visuals, but the story feels like a cut-and-paste job of other sci-fi movies.",
             "userMeter" : 60,
             "userRating" : 3.2,
             "userReviews" : 69055
     "metacritic" : 48,
     "awards" : {
             "wins" : 1,
             "nominations" : 7,
             "text" : "1 win & 7 nominations."
     "type" : "movie"

Import the Data

Before you can use your dataset with Charts, you need to add it to a MongoDB collection. Use mongoimport to import the contents of that file into the test.movieDetails collection on your Atlas cluster.

mongoimport --host <atlasHostname> --ssl -u <username> -p <password> --authenticationDatabase admin \
--db test --collection movieDetails \
--drop --file <path/to/movieDetails.json>


Refer to mongoimport for more information on using the import tool to add data to a MongoDB collection.

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.movieDetails collection.

  6. Click Set Permissions.

    Leave the permissions as the default Private option. For more information on user permissions in Charts, see permissions.

  7. Click Publish Data Source.

You’re now ready to create a dashboard and start adding charts to it.

Next Steps

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