Question · NestJS course · Module 10: Data Validation

@Exclude Decorator

What does the @Exclude() decorator from the class-transformer library do?

Answer options

  • Removes the field from the database
  • Disables validation for the given field
  • Blocks access to the field in TypeScript
  • Hides the field when converting the object to a JSON response

You can check the correct answer by solving this task in the CodeWorlds game.