How to exclude entity field from returned by controller JSON. NestJS + Typeorm

前端 未结 7 1585
小蘑菇
小蘑菇 2020-12-06 05:26

I want to exclude password field from returned JSON. I am using NestJS and Typeorm.

The solution provided on this question doesn\'t work for me or in NestJS. I can

7条回答
  •  情话喂你
    2020-12-06 05:40

    You can use the package https://github.com/typestack/class-transformer

    You can exclude a properties using decorators and also, you can exlude properties using groups.

提交回复
热议问题