add-query-filter

Add custom query parameter filters to entity endpoints for REST APIs.

1|Updated May 21, 2025
One-click install
npx skills add https://github.com/madooei/backend-template --skill add-query-filter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-query-filter
Source: https://github.com/madooei/backend-template/tree/main/.claude/skills/add-query-filter
Command: npx skills add https://github.com/madooei/backend-template --skill add-query-filter

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Add custom query parameter filters to entity endpoints to extend search and filtering capabilities beyond base pagination, enabling more precise data retrieval for complex queries.

Core Features & Use Cases

  • Define and apply entity-specific filters in query params for schema validation and repository queries.
  • Extend both mock repositories and MongoDB repositories to support new filter criteria.
  • Use case: Combine filters such as status, date, and createdBy to narrow results across large datasets.

Quick Start

Update the entity schema to include the new filter and implement corresponding filtering logic in both MockDB and MongoDB repositories, then add tests to validate the new behavior.

Frequently Asked Questions about add-query-filter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add custom query parameter filters to REST API endpoints?

Define custom query parameter filters in your entity schema and implement the corresponding filtering logic in both MockDB and MongoDB repositories to extend search capabilities for precise data retrieval across large datasets.

How does query filtering work with MongoDB and MockDB repositories?

Query filtering enforces input coercion and type validation across both MockDB and MongoDB repository implementations to ensure reliable, safe filtering behavior when applying custom query parameters to entity endpoints.

Can I combine multiple filters like status, date, and createdBy in a single API query?

Yes, you can combine multiple filters such as status, date, and createdBy to narrow results across large datasets, extending search and filtering beyond base pagination for more precise data retrieval in REST APIs.

Do I need to update schema definitions when adding new query filters?

Yes, updating the entity schema to include the new filter and implementing corresponding filtering logic in both MockDB and MongoDB repositories is required, with tests added to validate the new behavior.

What type validation and input coercion does query filtering enforce?

Query filtering enforces proper input coercion and type validation to ensure reliable, safe filtering behavior across schema definitions and both MockDB and MongoDB repository implementations for REST APIs.

How do I test custom query filters for entity endpoints?

Add tests to validate the new behavior after updating the entity schema and implementing filtering logic in both MockDB and MongoDB repositories, ensuring reliable filtering functionality across implementations.