Filtering by field values
📖 Scenario: You are building a simple REST API that returns a list of books. Users want to filter books by their genre.
🎯 Goal: Create a REST API endpoint that returns only books matching a given genre filter.
📋 What You'll Learn
Create a list of books with exact fields and values
Add a variable to hold the genre filter
Filter the books list by the genre field using the filter variable
Return the filtered list as JSON output
💡 Why This Matters
🌍 Real World
Filtering data by field values is common in APIs to let users get only the data they want.
💼 Career
Backend developers often write code to filter database or API data based on user requests.
Progress0 / 4 steps