typegoose

How to serialize a nest js response with class-transformer while getting data with Typegoose?

帅比萌擦擦* 提交于 2021-02-07 20:13:34
问题 I have been trying to work through the NestJs example for the Serialization Section for Mongodb using Typegoose using the class-transformer library. The example given at https://docs.nestjs.com/techniques/serialization only shows how to use serialization in TypeORM. I followed the same process for Typegoose. Here is what I have tried so far. // cat.domain.ts import { prop } from '@typegoose/typegoose'; export class Cat { @prop() name: string; @prop() age: number; @prop() breed: string; } //