Category "class-transformer"

class validator not working with class transformer's type function

class Product { @Min(0, { message: 'should be positive number' }) @IsNotEmpty({ message: 'should not be empty' }) @Type(() => Number) price: number;

How to have class-transform converting properly the _id of a mongoDb class?

I've the following mongoDb class: @Schema() export class Poker { @Transform(({ value }) => value.toString()) _id: ObjectId; @Prop() title: string;