Throughout this course, we will be leveraging the excellent sample data available from MongoDB Atlas. This short guide will provide a short set of steps to help you create a new project in Atlas, as well as adding the sample data.
NOTE This guide assumes that you still have your MongoDB Atlas account from BTI325. If this is not the case, please create a new account and follow the below steps.
Once you log into MongoDB Atlas, you will be taken to your default project page. On the bar on the left, you should see a green “context” label, followed by a drop down with your current project (likely Project 0). To create a new Project, simply click on the drop down and click “New Project” at the bottom.
Next, simply give a name to your project (keep it simple, something like “Project 1”). Once you have a name, click “Next”
On this step, simply click “Create Project”. It should automatically add yourself as the “Project Owner”.
Once Step 3 is complete, you can go ahead and create a cluster for your Project by clicking “Build a Cluster”.
This should take you to a screen where you can configure your cluster. Just as we did in BTI325, pick the FREE options.
Now that our new project has a new cluster, we can load the sample data. At the main screen for your newly created cluster (Cluster 0), you should see a button with elipsis dots on it (“…”)
Click this to open a new menu and click the “Load Sample Dataset” menu item:
This should open a new modal window asking you to “confirm that you want to load the sample dataset.”
Simply click the “Load Sample Dataset” button and prepare to wait for a few minutes while your datasets are populated.
If you click on the collections button now, you should see that you now have access to some awesome datasets! Specifically:
NOTE: To get the connection string to connect to this database, you will have to go through the same procedure as BTI325 (ie: click the “connect” button and whitelist the IP address 0.0.0.0/0 and create a user before clicking “Connect Your Application”). For a refresher on how to do this, please see the Week 8 notes for BTI325 under “Setting up a MongoDB Atlas account”.
Do not forget that once you get your connection string, replace the instance of “test” with the database that you wish to connect to, ie: “sample_supplies”.