Codex: The MongoDB Manifest
Infrastructure
Section titled “Infrastructure”| Component | Definition |
|---|---|
| Atlas | The Cloud Service (The Facility). |
| Cluster | The Server Instance (The Building). |
| Project | The Grouping of Clusters (The Job Site). |
| Database User | The credentials for the Application/Shell to access data. |
Terminal Commands (Mongosh)
Section titled “Terminal Commands (Mongosh)”Connection
Section titled “Connection”mongosh "mongodb+srv://<cluster-url>/" --username <user>Navigation
Section titled “Navigation”// Show all databasesshow dbs
// Switch to a database (creates it if it doesn't exist)use node2know
// Show collections in current dbshow collectionsCreate and Read Operations
Section titled “Create and Read Operations”Create (Insert)
// Singledb.projects.insertOne({ title: "Solo App" });
// Multipledb.projects.insertMany([{ title: "App A" }, { title: "App B" }]);Read (Find)
// Find Alldb.projects.find();
// Find One (First Match)db.projects.findOne({ title: "Solo App" });
// Filtered Finddb.projects.find({ category: "game" });Safety Protocol
Always verify we are in the correct database (db) before running commands.
Extra Bits & Bytes
Section titled “Extra Bits & Bytes”📘 MongoDB Fundamentals: The Vault Approach (PDF)
📘 MongoDB (Mongosh) Cheatsheet Part 1 (PNG)
⏭ Next Chapter: Mongoose
Section titled “⏭ Next Chapter: Mongoose”Automating the Vault interactions with strict schemas.