The Pit Stop Challenge
Simulation Mode: Active
Section titled “Simulation Mode: Active”Reading the manual is fine, but we don’t know the car until we’ve driven it. Get in the seat.
Challenge 1: The Standard Tune-Up (Maintenance)
Section titled “Challenge 1: The Standard Tune-Up (Maintenance)”Scenario: We need a new collection for “Team Members.”
Task: Define a Schema with a name (String), role (String), and isDriver (Boolean). Compile it into a Model named Member.
Write a Mongoose schema for a ‘Member’ with name, role, and isDriver fields.
Challenge 2: The Custom Mod (Medium)
Section titled “Challenge 2: The Custom Mod (Medium)”Scenario: We need to find all projects that are NOT active.
Task: Write a getArchivedProjects function that returns all documents where isActive is false.
/* Function: getArchivedProjects() Returns: Array of projects where isActive is false*/How do I filter a Mongoose query to find documents where a boolean field is false?
Challenge 3: The Solo Special (Hard)
Section titled “Challenge 3: The Solo Special (Hard)”Scenario: A user wants to search for projects by slug, but they might type it in UPPERCASE using SPACES (e.g., “MY COOL APP”).
Task: Write a function that takes a messy input string, converts it to a proper slug (lowercase, hyphens), and then searches the database for it.
Write a JavaScript function to regex replace spaces with hyphens and convert to lowercase.
⏭ Next: The Codex
Section titled “⏭ Next: The Codex”Tools down. Let’s document what we learned.