Skip to content

Instantly share code, notes, and snippets.

@shannonbradshaw
Last active July 12, 2017 12:25
Show Gist options
  • Save shannonbradshaw/7ec49f396ba5c7a33cff1bd1f252791e to your computer and use it in GitHub Desktop.
Save shannonbradshaw/7ec49f396ba5c7a33cff1bd1f252791e to your computer and use it in GitHub Desktop.

Overview

Here you will find instructions for importing the results dataset for the final week of M001: MongoDB Basics into a locally running MongoDB deployment.

Datasets

This dataset is provided in Amazon S3 in a single zip file (9 KB zipped; 147 KB unzipped). The files were created with the mongodump command. This dataset may be imported into your MongoDB deployment using mongorestore. The database included is as follows.

  • results (147 KB) - two collections -- scores and surveys -- which contain simple contrived documents used for some quizzes and final exam questions

Importing Data Locally

These instructions will help you load the results dataset into a local MongoDB instance (e.g., MongoDB running on your laptop).

  1. Download the m001-results-dataset.zip file (9 KB) from S3.
  2. Unzip m001-results-dataset.zip. This will create a directory/folder called dump.
  3. Ensure you have a running MongoDB instance. For instructions on installation and setup, see the MongoDB installation documentation. Installation tutorials for all platforms include instructions for running MongoDB (the mongod daemon).
  4. Once you have a mongod instance running, you may import the dataset using mongorestore.
    1. Open a command shell (e.g., bash, powershell, or cmd).
    2. Change directory (e.g., cd) to where you unzipped m001-results-dataset.zip.
    3. Assuming you are running mongod on the default port, you may import the dataset from the dump directory by simply running, mongorestore. mongorestore looks for a directory called dump to import.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment