Getting Started with MongoDB

See what people build with MongoDB and the projects you'll build in this course, then install MongoDB, mongosh and Compass (or make a free cloud database), and the tools the exercises use. Store your first recipes, look at them in Compass, and hand in your first exercise on GitHub.

Updated

What MongoDB Can Do

  1. What You Can Build with MongoDB (Novice): A database keeps an app's data safe and answers its questions in a blink, and MongoDB keeps each record as a document, like a filled-in recipe card, which suits recipe sites, store orders, pet adoption sites and the five projects you'll build in this course.
  2. How This Course Works (Novice): How MongoDB in Depth works on ask-codey.com, from reading a lesson and running its queries in mongosh to exercises checked by tests, chapter checks, module assessments and the projects you build.

Setting Up MongoDB

  1. Setup: MongoDB, mongosh and Compass (Novice): Install MongoDB Community Server, mongosh and Compass on Windows with winget or on a Mac with Homebrew, check that the server is running in the background, and connect to it with mongosh at mongodb://localhost:27017.
  2. Another Way: A Free Cluster on MongoDB Atlas (Novice): Make a free MongoDB Atlas cluster in the browser, with a database user and your IP address on its access list, connect mongosh and Compass to it with its mongodb+srv connection string, and stay on the Free tier so nothing costs money.
  3. Setup for the Exercises: Node.js, Git and VS Code (Novice): Install VS Code, the LTS version of Node.js and Git on Windows or macOS, check them with --version, make a free GitHub account, tell Git your name and email, and make the mongodb-course folder every exercise goes in.

Your First Database

  1. Your First Documents in mongosh (Novice): Start mongosh, see the databases with show dbs, choose one with use, add Sunday Kitchen's first three recipes with insertOne, list them with find, and leave with exit.
  2. Looking Around in Compass (Novice): Connect Compass to mongodb://localhost:27017, find the sunday_kitchen database and its recipes in the sidebar, see the documents as a list, as JSON and as a table, filter them, fix a typo in one, and choose between Compass and mongosh.

Share Your Work

  1. Get the Exercise Code with Git (Novice): Copy an exercise's repository from GitHub into your course folder with git clone, open the folder it makes in VS Code, and see with git status and git remote -v that your copy remembers where it came from.
  2. Hand In Your Work with Git (Novice): Hand in an exercise by making a public repository of your own on GitHub, pointing your clone at it with git remote set-url, saving your work with git add and git commit, sending it with git push, and submitting the repository's address.

Exercise: Your First Recipes

  1. Exercise: Your First Recipes (Novice): Add two of Sunday Kitchen's recipe cards with insertOne, find every recipe and one by its name with find, all as mongosh statements, then let the tests check each one and hand your work in with Git.