Navigation
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.

Load the Sample Data

Estimated Time to Complete: 10 minutes

Prerequisites

To complete this tutorial you will need a MongoDB Atlas cluster. Refer to the Create a Cluster documentation for instructions on creating an Atlas cluster.

Load the Sample Data into Your Atlas Cluster

Atlas provides sample data you can load into your Atlas cluster. To load sample data into your cluster:

1

Log in to Atlas.

Log in to your Atlas account at https://cloud.mongodb.com.

2
3

Load the sample dataset.

  1. Click the Ellipses (…) button for your cluster.
  2. Click Load Sample Dataset.

Atlas begins loading your sample data. This operation takes approximately 5 minutes to complete.

The following is a sample document from the dataset:

{
  "_id": {
    "$oid": "573a1390f29313caabcd413b"
  },
  "title": "The Arrival of a Train",
  "year": {
    "$numberInt": "1896"
  },
  "runtime": {
    "$numberInt": "1"
  },
  "released": {
    "$date": {
      "$numberLong": "-2335219200000"
    }
  },
  "poster": "http://ia.media-imdb.com/images/M/   MV5BMjEyNDk5MDYzOV5BMl5BanBnXkFtZTgwNjIxMTEwMzE@._V1_SX300.jpg",
  "plot": "A group of people are standing in a straight line along the
    platform of a railway station, waiting for a train, which is seen
    coming at some distance. When the train stops at the platform, ...",
  "fullplot": "A group of people are standing in a straight line along
    the platform of a railway station, waiting for a train, which is
    seen coming at some distance. When the train stops at the platform,
    the line dissolves. The doors of the railway-cars open, and people
    on the platform help passengers to get off.",
  "lastupdated": "2015-08-15 00:02:53.443000000",
  "type": "movie",
  "directors": [
    "Auguste Lumière",
    "Louis Lumière"
  ],
  "imdb": {
    "rating": {
      "$numberDouble": "7.3"
    },
    "votes": {
      "$numberInt": "5043"
    },
    "id": {
      "$numberInt": "12"
    }
  },
  "countries": [
    "France"
  ],
  "genres": [
    "Documentary",
    "Short"
  ],
  "tomatoes": {
    "viewer": {
      "rating": {
        "$numberDouble": "3.7"
      },
      "numReviews": {
        "$numberInt": "59"
      }
    },
    "lastUpdated": {
      "$date": {
        "$numberLong": "1441993589000"
      }
    }
  },
  "num_mflix_comments": {
    "$numberInt": "1"
  }
}

Add the Mflix Collections as Data Sources

Once the load operation completes, you can add the collections containing the sample data as data sources in Charts. Adding a collection as a data source links the collection to Charts and allows you to visualize that data.

1

Launch MongoDB Charts.

Click Charts in the left navigation pane in Atlas to launch MongoDB Charts. This launches an instance of MongoDB Charts linked to your Atlas project.

2

In MongoDB Charts, click the Data Sources tab.

3

In the Data Sources view, click New Data Source.

4

Select your Atlas project.

In the Connect to Deployment step of the dialog, select the Atlas Project which contains the sample data.

5

Click Connect.

6

Select the sample movie collections.

In the Choose Collections step of the dialog, select the sample_mflix database from the list. Select all collections from the sample_mflix database.

7

Click Set Permissions.

8

Leave these options as default and click Publish Data Source.

Note

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 hold the visualizations.