NestJS Search & CQRS

Implement CQRS patterns and Elasticsearch integration in NestJS applications.

Updated Jan 22, 2026
One-click install
npx skills add https://github.com/ngxtm/skill-rule --skill nestjs-search-cqrs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: NestJS Search & CQRS
Source: https://github.com/ngxtm/skill-rule/tree/main/rules/nestjs/search
Command: npx skills add https://github.com/ngxtm/skill-rule --skill nestjs-search-cqrs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of efficiently searching and managing data in NestJS applications, particularly when dealing with complex queries and the need for optimized read performance.

Core Features & Use Cases

  • CQRS Pattern Implementation: Separates command and query responsibilities for better scalability and maintainability.
  • Search Engine Integration: Connects with Elasticsearch (or similar) for advanced full-text search capabilities.
  • Synchronization Strategies: Provides guidance on keeping the search index consistent with the primary database, recommending event-driven approaches over dual writes.
  • Use Case: Implementing a product catalog search in an e-commerce application where users can perform fuzzy searches, filter by category and price, and get paginated results.

Quick Start

Use the NestJS Search & CQRS skill to index a new product document into Elasticsearch.

Frequently Asked Questions about NestJS Search & CQRS

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

FAQPage Schema
How do I implement CQRS pattern with Elasticsearch in a NestJS application?

To implement CQRS with Elasticsearch in NestJS, you separate command and query responsibilities, using the search engine specifically for optimized data retrieval and full-text search queries.

What is the best way to synchronize data between a primary database and Elasticsearch in NestJS?

The best way to synchronize data is using event-driven approaches rather than dual writes, ensuring data consistency between your primary database and the Elasticsearch search index.

When do I need full-text search integration in NestJS?

You need full-text search integration when dealing with complex queries and requiring optimized read performance, such as implementing a product catalog search with fuzzy searches, filtering, and paginated results.

Can I use event-driven synchronization instead of dual writes for my NestJS search index?

Yes, you can use event-driven synchronization to maintain search index consistency, which is recommended over dual writes to prevent data anomalies between your primary database and Elasticsearch.

Does NestJS Search & CQRS support fuzzy searches and filtering for e-commerce catalogs?

Yes, the search engine integration supports advanced full-text search capabilities, allowing users to perform fuzzy searches, filter by category and price, and retrieve paginated results for e-commerce applications.

How to optimize data retrieval for complex queries in NestJS?

You optimize data retrieval by integrating Elasticsearch for advanced search capabilities and applying the CQRS pattern to separate query responsibilities, which improves scalability and maintainability.