Introduction to MongoDB

Jul 13, 2024

Introduction to MongoDB

Presented by: Jesse Hall

  • Senior Developer Advocate at MongoDB
  • Known as Code Stacker on YouTube

Agenda

  1. Document Database Basics
  2. Create a Free MongoDB Atlas Cluster
  3. Load Data into Cluster from JSON File
  4. Clone an E-commerce Project
  5. Connect App to MongoDB Atlas

Document Database Basics

Relational Databases

  • SQL Databases: Data stored in rows & columns, similar to spreadsheets
  • Separate Tables: Related data stored in separate tables to prevent duplication
  • Example:
    • Users table
    • Phone numbers table related to users via user IDs
    • Queries require joining tables to get related data

Document Databases

  • MongoDB: Data stored in JSON documents
  • JSON: JavaScript Object Notation, key-value pairs, very flexible
    • Stores many data types: strings, numbers, booleans, arrays, nested objects
  • Single Document: Related data stored together, eliminating need for separate tables
  • Example Syntax: JSON formatted data