EventGet 50% off your ticket to MongoDB.local NYC on May 2. Use code Web50!Learn more >>
MongoDB Developer
Atlas
plus
Sign in to follow topics
MongoDB Developer Centerchevron-right
Developer Topicschevron-right
Productschevron-right
Atlaschevron-right

The MongoDB Atlas Sample Datasets

Eoin Brazil8 min read • Published Jan 19, 2022 • Updated May 31, 2022
Atlas
Facebook Icontwitter iconlinkedin icon
Rate this article
star-empty
star-empty
star-empty
star-empty
star-empty
Did you know that MongoDB Atlas provides a complete set of example data to help you learn faster? The Load Sample Data feature enables you to load eight datasets into your database to explore. You can use this with the MongoDB Atlas M0 free tier to try out MongoDB Atlas and MongoDB's features. The sample data helps you try out features such as indexing, querying including geospatial, and aggregations, as well as using MongoDB Tooling such as MongoDB Charts and MongoDB Compass.
In the rest of this post, we'll explore why it was created, how to first load the sample data, and then we'll outline what the datasets contain. We'll also cover how you can download these datasets to use them on your own local machine.

Table of Contents

Why Did We Create This Sample Data Set?

Before diving into how we load the sample data, it's worth highlighting why we built the feature in the first place. We built this feature because often people would create a new empty Atlas cluster and they'd then have to wait until they wrote their application or imported data into it before they were able to learn and explore the platform. Atlas's Sample Data was the solution. It removes this roadblock and quickly allows you to get a feel for how MongoDB works with different types of data.

Loading the Sample Data Set into Your Atlas Cluster

Loading the Sample Data requires an existing Atlas cluster and three steps.
  • In your left navigation pane in Atlas, click Clusters, then choose which cluster you want to load the data into.
  • For that cluster, click the Ellipsis (...) button.
  • Then, click the button "Load Sample Dataset."
  • Click the correspondingly named button, "Load Sample Dataset."
This process will take a few minutes to complete, so let's look at exactly what kind of data we're going to load. Once the process is completed, you should see a banner on your Atlas Cluster similar to this image below.

A Deeper Dive into the Atlas Sample Data

The Atlas Sample Datasets are comprised of eight databases and their associated collections. Each individual dataset is documented to illustrate the schema, the collections, the indexes, and a sample document from each collection.

Sample AirBnB Listings Dataset

This dataset consists of a single collection of AirBnB reviews and listings. There are indexes on the property type, room type, bed, name, and on the location fields as well as on the _id of the documents.
The data is a randomized subset of the original publicly available AirBnB dataset. It covers several different cities around the world. This dataset is used extensively in MongoDB University courses.
You can find more details on the Sample AirBnB Documentation page.

Sample Analytics Dataset

This dataset consists of three collections of randomly generated financial services data. There are no additional indexes beyond the _id index on each collection. The collections represent accounts, transactions, and customers.
The transactions collection uses the Bucket Pattern to hold a set of transactions for a period. It was built for MongoDB's private training, specifically for the MongoDB for Data Analysis course.
The advantages in using this pattern are a reduction in index size when compared to storing each transaction in a single document. It can potentially simplify queries and it provides the ability to use pre-aggregated data in our documents.
You can find more details on the Sample Analytics Documentation page.

Sample Geospatial Dataset

This dataset consists of a single collection with information on shipwrecks. It has an additional index on the coordinates field (GeoJSON). This index is a Geospatial 2dsphere index. This dataset was created to help explore the possibility of geospatial queries within MongoDB.
The image below was created in MongoDB Charts and shows all of the shipwrecks on the eastern seaboard of North America.
You can find more details on the Sample Geospatial Documentation page.

Sample Mflix Dataset

This dataset consists of five collections with information on movies, movie theatres, movie metadata, and user movie reviews and their ratings for specific movies. The data is a subset of the IMDB dataset. There are three additional indexes beyond _id: on the sessions collection on the user_id field, on the theatres collection on the location.geo field, and on the users collection on the email field. You can see this dataset used in this MongoDB Charts tutorial.
The Atlas Search Movies site uses this data and MongoDB's Atlas Search to provide a searchable movie catalog.
This dataset is the basis of our Atlas Search tutorial.
You can find more details on the Sample Mflix Documentation page.

Sample Restaurants Dataset

This dataset consists of two collections with information on restaurants and neighbourhoods in New York. There are no additional indexes. This dataset is the basis of our Geospatial tutorial. The restaurant document only contains the location and the name for a given restaurant.
In order to use the collections for geographical searching, we need to add an index, specifically a 2dsphere index. We can add this index and then search for all restaurants in a one-kilometer radius of a given location, with the results being sorted by those closest to those furthest away. The code below creates the index, then adds a helper variable to represent 1km, which our query then uses with the $nearSphere criteria to return the list of restaurants within 1km of that location.
You can find more details on the Sample Restaurants Documentation page.

Sample Supply Store Dataset

This dataset consists of a single collection with information on mock sales data for a hypothetical office supplies company. There are no additional indexes. This is the second dataset used in the MongoDB Chart tutorials.
The sales collection uses the Extended Reference pattern to hold both the items sold and their details as well as information on the customer who purchased these items. This pattern includes frequently accessed fields in the main document to improve performance at the cost of additional data duplication.
You can find more details on the Sample Supply Store Documentation page.

Sample Training Dataset

This dataset consists of nine collections with no additional indexes. It represents a selection of realistic data and is used in the MongoDB private training courses.
It includes a number of public, well-known data sources such as the OpenFlights, NYC's OpenData, and NYC's Citibike Data.
The routes collection uses the Extended Reference pattern to hold OpenFlights data on airline routes between airports. It references airline information in the airline sub document, which has details about the specific plane on the route. This is another example of improving performance at the cost of minor data duplication for fields that are likely to be frequently accessed.
You can find more details on the Sample Training Documentation page.

Sample Weather Dataset

This dataset consists of a single collection with no additional indexes. It represents detailed weather reports from locations across the world. It holds geospatial data on the locations in the form of legacy coordinate pairs.
You can find more details on the Sample Weather Documentation page.
If you have ideas or suggestions for new datasets, we are always interested. Let us know on the developer community website.

Downloading the Dataset for Use on Your Local Machine

It is also possible to download and explore these datasets on your own local machine. You can download the complete sample dataset via the wget command:
Note: You can also use the curl command:
You should check you are running a local mongod instance or you should start a new mongod instance at this point. This mongod will be used in conjunction with mongorestore to unpack and host a local copy of the sample dataset. You can find more details on starting mongod instances on this documentation page.
This section assumes that you're connecting to a relatively straightforward setup, with a default authentication database and some authentication set up. (You should always create some users for authentication!)
If you don't provide any connection details to mongorestore, it will attempt to connect to MongoDB on your local machine, on port 27017 (which is MongoDB's default). This is the same as providing --host localhost:27017.
You can use a variety of tools to view your documents. You can use MongoDB Compass, the CLI, or the MongoDB Visual Studio Code (VSCode) plugin to interact with the documents in your collections. You can find out how to use MongoDB Playground for VSCode and integrate MongoDB into a Visual Studio Code environment.
If you find the sample data useful for building or helpful, let us know on the community forums!

Wrap Up

These datasets offer a wide selection of data that you can use to both explore MongoDB's features and prototype your next project without having to worry about where you'll find the data.
Check out the documentation on Load Sample Data to learn more on these datasets and load it into your Atlas Cluster today to start exploring it!
To learn more about schema patterns and MongoDB, please check out our blog series Building with Patterns and the free MongoDB University Course M320: Data Modeling to level up your schema design skills.
If you have questions, please head to our developer community website where the MongoDB engineers and the MongoDB community will help you build your next big idea with MongoDB.

Facebook Icontwitter iconlinkedin icon
Rate this article
star-empty
star-empty
star-empty
star-empty
star-empty
Related
Tutorial

Querying MongoDB in the Browser with React and the Web SDK


Sep 23, 2022 | 9 min read
Article

Coronavirus Map and Live Data Tracker with MongoDB Charts


Nov 15, 2023 | 3 min read
Article

Realm Triggers Treats and Tricks - Document-Based Trigger Scheduling


Sep 23, 2022 | 5 min read
Tutorial

Exploring Window Operators in Atlas Stream Processing


Feb 13, 2024 | 4 min read
Table of Contents
  • Table of Contents
  • Why Did We Create This Sample Data Set?
  • Loading the Sample Data Set into Your Atlas Cluster
  • A Deeper Dive into the Atlas Sample Data
  • Sample AirBnB Listings Dataset
  • Sample Analytics Dataset
  • Sample Geospatial Dataset
  • Sample Mflix Dataset
  • Sample Restaurants Dataset
  • Sample Supply Store Dataset
  • Sample Training Dataset
  • Sample Weather Dataset
  • Downloading the Dataset for Use on Your Local Machine
  • Wrap Up