Guided Notes
Introduction to MongoDB
Documents, collections, and how MongoDB differs from SQL.
MongoDB is a document database: instead of rows in tables, it stores JSON-like documents in collections. A document can nest arrays and objects directly, without needing a join to related tables.
Two documents in the same collection don't need identical fields — this flexible schema makes MongoDB a natural fit for data that varies shape or evolves over time.
Querying uses a JSON-like syntax: `db.users.find({ age: { $gt: 30 } })` finds every user document where age is greater than 30 — conceptually similar to SQL's WHERE, expressed differently.