This page demonstrates real-world filtering scenarios using theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/charlietyn/rest-generic-class/llms.txt
Use this file to discover all available pages before exploring further.
oper parameter and relation filtering capabilities.
Overview
The Rest Generic Class package provides powerful filtering through theoper parameter, supporting:
- Simple equality and comparison operators
- Complex AND/OR logic trees
- Relation-based filtering
- Date range queries
- Full-text search patterns
E-Commerce Product Search
Scenario 1: Basic Product Catalog Filter
Goal: Show active products in stock within a price range.Scenario 2: Search by Name with Category Filter
Goal: Search for “keyboard” products in the Electronics category.The
like operator uses SQL LIKE syntax. Use % as a wildcard for partial matches. For case-insensitive searches, your database collation determines behavior.Scenario 3: Complex OR Logic - Clearance or New Arrivals
Goal: Show products that are either on clearance (low stock) or newly added.Scenario 4: Multi-Category Filter
Goal: Show products from multiple categories using IN operator.Date Range Queries
Scenario 5: Products Created This Month
Goal: List all products added in the current month.Scenario 6: Recently Updated Products
Goal: Find products updated in the last 7 days.Scenario 7: Seasonal Product Filter
Goal: Show products relevant to a specific season with date-based logic.Relation-Based Filtering
Scenario 8: Filter by Nested Relation
Goal: Find products with highly-rated reviews (rating >= 4).Scenario 9: Filter by Category and Subcategory
Goal: Show products from Electronics category where subcategory is “Accessories”.Scenario 10: Products with Tags
Goal: Find products tagged with specific keywords (many-to-many relation).Multi-Condition Complex Filters
Scenario 11: Advanced Search with All Features
Goal: Comprehensive search combining text, price, date, stock, and relations.Scenario 12: Exclude Specific Items
Goal: Show all products except specific excluded IDs and categories.Scenario 13: Null/Not Null Checks
Goal: Find products with or without a description.Performance Optimization Tips
Supported Operators
| Operator | Example | Description |
|---|---|---|
= | status|=|active | Exact match |
!= | status|!=|inactive | Not equal |
> | price|>|100 | Greater than |
>= | price|>=|100 | Greater or equal |
< | stock|<|10 | Less than |
<= | stock|<=|10 | Less or equal |
like | name|like|%keyboard% | Pattern match |
not like | name|not like|%test% | Pattern exclusion |
in | id|in|1,2,3 | In list |
not in | id|not in|5,6 | Not in list |
is | deleted_at|is|null | Null check |
is not | deleted_at|is not|null | Not null check |
between | price|between|50,100 | Range (inclusive) |
All operators are validated against the package’s allowlist. Custom operators can be added via configuration if needed.
Common Mistakes
Next Steps
- Learn about Cache Strategies to optimize repeated queries
- Explore Edge Cases for troubleshooting filter issues
- Review Configuration Reference for filter limits and operator customization