What is the primary advantage of using Mongoose with NestJS for database integration?
Mongoose is used for managing relational databases in NestJS
Mongoose automatically generates frontend UI components
Mongoose provides a schema-based solution for modeling data in MongoDB
Mongoose enables direct execution of SQL queries on MongoDB
What is the role of a Repository in TypeORM?
To provide methods for interacting with a specific entity
To define database tables
To manage database migrations
To handle user authentication
What is the role of the 'transform()' method within a custom Pipe in NestJS?
It determines if the Pipe should be applied globally.
It contains the logic to transform the input data.
It specifies how the Pipe should handle errors.
It defines the metadata associated with the Pipe.
Which module is essential for implementing JWT authentication in a NestJS application?
@nestjs/passport
@nestjs/common
@nestjs/jwt
@nestjs/core
When might you choose to use a custom decorator instead of middleware in NestJS?
When you need access to the request or response objects within the logic.
When you need to perform asynchronous operations before or after a request.
When the logic you want to apply is highly specific to a single method or parameter.
When you want to modify the routing behavior of your application.
Which NestJS module is essential for creating TCP-based microservices?
@nestjs/microservices
@nestjs/platform-express
What object in the intercept() method of a transformation interceptor allows you to modify the response stream?
intercept()
context.getRequest()
context.getNext()
context.switchToWs().getClient()
context.switchToHttp().getResponse()
In TypeORM, what is the purpose of an Entity?
To define routes in a NestJS application
To handle HTTP requests
To define database tables and their columns
To manage database connections
What is the role of the @SetMetadata decorator in NestJS?
@SetMetadata
It attaches metadata to a class or method.
It validates the data type of a method parameter.
It defines a custom decorator factory.
It applies middleware to a specific route handler.
How does the CQRS pattern improve the design of event-driven systems?
By simplifying the handling of complex events
By eliminating the need for event listeners
By enforcing synchronous communication between components
By separating read and write operations for better performance and scalability