Skip to content

Codex: The MongoDB Manifest

ComponentDefinition
AtlasThe Cloud Service (The Facility).
ClusterThe Server Instance (The Building).
ProjectThe Grouping of Clusters (The Job Site).
Database UserThe credentials for the Application/Shell to access data.
Terminal window
mongosh "mongodb+srv://<cluster-url>/" --username <user>
// Show all databases
show dbs
// Switch to a database (creates it if it doesn't exist)
use node2know
// Show collections in current db
show collections

Create (Insert)

// Single
db.projects.insertOne({ title: "Solo App" });
// Multiple
db.projects.insertMany([{ title: "App A" }, { title: "App B" }]);

Read (Find)

// Find All
db.projects.find();
// Find One (First Match)
db.projects.findOne({ title: "Solo App" });
// Filtered Find
db.projects.find({ category: "game" });
Safety Protocol

Always verify we are in the correct database (db) before running commands.

📘 MongoDB Fundamentals: The Vault Approach (PDF)

📘 MongoDB (Mongosh) Cheatsheet Part 1 (PNG)

Automating the Vault interactions with strict schemas.