Codecademy - Learn MongoDB

Notes taken while going through the Codecademy Learn MongoDB course

Introduction to Databases

What is a Database?

Why Databases?

Database Management Systems (DBMS)

Relational Databases

Non-Relational Databases

Review: Introduction to Databases

Useful Links:

  • Comprehensive list of database classifications
  • A deeper dive into NoSQL vs SQL

  • Database Basics - Cheatsheet
  • Introduction to No-SQL

    Introduction to No-SQL

    Arriving at No-SQL

    Is No-SQL the Right Option?

    Types of No-SQL Databases

    Review: Introduction to No-SQL

    Introduction to MongoDB

    Introduction

    What is MongoDB?

    Advantages of Using MongoDB

    Review: Introduction to MongoDB


  • Introduction to MongoDB - Cheatsheet
  • MongoDB & Data

    Collections & Documents

    Data as JSON

    BSON - MongoDB’s Storage Format

    Review: MongoDB & Data

    Useful Links:

  • SON and BSON Guide
  • Explaining BSON with Examples
  • MongoDB Data Modeling Basics

    Modeling Relationships in MongoDB

    Embedded Documents

    References

    Choosing the Right Model

    Case A: A time management application that stores one user per task. We want to store details about the task, such as the task name, the task due date, and the user assigned to the task (and their associated details). There can only be one person assigned to each task.

    Case B: A contact information management application that can store multiple addresses per user. The application would store important details for the person such as their name, as well as their associated addresses.

    Case C: A school registration application that manages multiple students. Each student can be in multiple classes. Each class record can easily identify which students are registered and each student record can quickly find any associated classes.

    Review: MongoDB Data Modeling Basics

    Useful Links:

  • Data Modeling Introduction
  • Model One-to-One Relationships with Embedded Documents
  • Model One-to-Many Relationships with Embedded Documents
  • Model One-to-Many Relationships with References
  • MongoDB University Data Modeling Course
  • MongoDB CRUD I - Finding Documents

    Browsing and Selecting Collections

    Introduction to Querying

    Querying Collections

    Querying Embedded Documents

    Comparison Operators: $gt and $lt

    Sorting Documents

    Query Projections

    Review: MongoDB CRUD I - Finding Documents

    MongoDB CRUD I - Querying on Array Fields

    Querying for an Entire Array

    Matching Individual Array Elements

    Matching Multiple Array Elements with $all

    Querying on Compound Filter Conditions

    Querying for all conditions with $elemMatch

    Querying an Array of Embedded Documents


  • Query an Array of Embedded Documents
  • Review: Querying on Array Fields


  • MongoDB CRUD I - Cheatsheet
  • MongoDB CRUD II Inserting & Updating

    The _id Field

    Inserting a Single Document

    Inserting Multiple Documents

    Updating a Single Document

    Updates on Embedded Documents and Arrays

    Updating an Array with New Elements

    Upserting a Document

    Updating Multiple Documents

    Modifying Documents

    Review: MongoDB CRUD II Inserting & Updating


  • MongoDB CRUD II - Cheatsheet
  • MongoDB CRUD II Deleting Documents

    Deleting a Document

    Deleting Multiple Documents

    Replacing a Document

    Review: MongoDB CRUD II Deleting Documents

    Indexing in MongoDB

    What is Indexing?

    The Types of Indexes in MongoDB

    Tradeoffs and Precautions When Working with Indexes

    Single Field Index

    Performance Insights with .explain()

    Compound Indexes

    Multikey Index on Single Fields

    Multikey Index on Compound Fields

    Deleting an Index

    Review: Indexing in MongoDB

    Useful Links:

  • Partial Indexes
  • Sparse Indexes
  • TTL Indexes
  • Unique Indexes

  • Indexing in MongoDB - Cheatsheet
  • Explore MongoDB Aggregation

    Introduction

    Aggregation Basics

    Getting Started with Aggregation

    Aggregation in Action: Building a Multi-Stage Aggregation Pipeline

    When to Use Aggregation

    Review: Explore MongoDB Aggregation

    Useful Links:

  • MongoDB: Aggregation Basics
  • MongoDB: Aggregation Pipeline Introduction

  • Explore MongoDB - Cheatsheet