How can you access the currently authenticated user's information within a NestJS controller after successful authentication?
By injecting the 'Request' object
By accessing the 'user' property of the 'req' object within the controller method
By querying the database directly within the controller
By using the 'AuthService'
What is the primary advantage of using Mongoose with NestJS for database integration?
Mongoose is used for managing relational databases in NestJS
Mongoose enables direct execution of SQL queries on MongoDB
Mongoose provides a schema-based solution for modeling data in MongoDB
Mongoose automatically generates frontend UI components
How do you activate a custom Guard globally in a NestJS application?
By registering the guard in the providers array of the module where it's defined.
providers
By using the @Global() decorator before the guard class definition.
@Global()
By defining the guard within the main.ts file of your application.
main.ts
By manually adding the guard to each route handler where it's needed.
What object in the intercept() method of a transformation interceptor allows you to modify the response stream?
intercept()
context.switchToWs().getClient()
context.switchToHttp().getResponse()
context.getNext()
context.getRequest()
What is a key advantage of using a message broker like RabbitMQ or Kafka for NestJS microservice communication?
Simplified database management
Reduced need for code testing
Automatic user interface generation
Improved error handling and retries
In JWT authentication, what does JWT stand for?
JSON Web Token
Java Web Token
JavaScript Web Token
Just Write Tests
What is the advantage of using a dedicated session store (like Redis) over in-memory storage for sessions in a production NestJS application?
Improved code readability
Scalability and session persistence across multiple server instances
Enhanced security for sensitive data
Simplified development setup
What is the primary purpose of a Guard in NestJS?
To control access to routes or resources based on certain conditions.
To render HTML templates on the server.
To define the structure of a request body.
To handle database interactions.
Which testing type provides the most comprehensive coverage by simulating real user interactions with a running NestJS application?
End-to-End (E2E) Testing
Integration Testing
Regression Testing
Unit Testing
Which of these is NOT a common method for storing session data in a NestJS application?
Database storage
In-memory storage
Local variable storage
File system storage