Share
Explore

Sample JSON for MongoDB Compass

Here is a ready-to-use set of JSON documents for students to paste into MongoDB Compass → Insert Document (or “Add Data → Insert Many”). These follow the Klingon Jokes DB demo, but I’ll also include a generic set (Ice Cream Shoppe) so you have both flavors.

📘 Sample JSON for MongoDB Compass

1. Klingon Jokes Collection (KlingonJokes)

Paste this entire array into Compass → Add Data → Insert Many:
[
{
"text": "A true warrior laughs before battle… at the programmer’s unit tests.",
"author": "Worf",
"rating": 3,
"tags": ["battle", "humor"]
},
{
"text": "Real warriors deploy on Friday. Cowards wait until Monday.",
"author": "Martok",
"rating": 5,
"tags": ["deploy", "honor"]
},
{
"text": "If it compiles, it is not yet worthy.",
"author": "Klingon Proverb",
"rating": 4,
"tags": ["code", "tradition"]
},
{
"text": "Segfaults are merely tests of honor.",
"author": "Gowron",
"rating": 2,
"tags": ["bug", "trial"]
},
{
"text": "Whitespace is for the weak.",
"author": "Kurn",
"rating": 1,
"tags": ["style"]
}
]

2. Ice Cream Shoppe (products, customers, orders)

Products Collection (products)

[
{ "name": "Vanilla Scoop", "price": 3.5, "inStock": true },
{ "name": "Chocolate Scoop", "price": 3.75, "inStock": true },
{ "name": "Mint Chip Scoop", "price": 3.95, "inStock": true },
{ "name": "Banana Split", "price": 7.5, "inStock": true },
{ "name": "Waffle Cone", "price": 1.0, "inStock": true }
]

Customers Collection (customers)

[
{ "name": "Amy Tan", "phone": "555-123-4567", "email": "amy.tan@example.edu" },
{ "name": "James Kirk", "phone": "555-987-6543", "email": "captain.kirk@example.com" },
{ "name": "Spock", "phone": "555-222-3333", "email": "spock@example.com" }
]

Orders Collection (orders)

[
{
"customer": "Amy Tan",
"products": ["Vanilla Scoop", "Waffle Cone"],
"orderDate": "2025-09-25",
"status": "paid",
"notes": "Extra sprinkles"
},
{
"customer": "James Kirk",
"products": ["Banana Split"],
"orderDate": "2025-09-24",
"status": "pending",
"notes": "Warp-speed delivery"
},
{
"customer": "Spock",
"products": ["Chocolate Scoop", "Mint Chip Scoop"],
"orderDate": "2025-09-23",
"status": "fulfilled",
"notes": "Highly logical combination"
}
]

🧭 Instructor Notes

These examples are denormalized (orders reference customer and product names).
In a real Mongoose model, you’d store ObjectIds and use .populate().
For Compass practice, keep it simple so cadets can:
Insert documents
Run queries (e.g., find all orders by "customer": "Amy Tan")
Experiment with filters ({ "status": "paid" }, { "products": "Banana Split" })
Intent: Students finish Phase 3 with real documents in Compass, ready to be consumed by the Express + Mongoose app in Phase 4.

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.