Mongoose Subdocuments in Nest.js

I dug into the source code and learned how Schema class is converted by the SchemaFactory.createForClass method. Well so how it works? 1. Take a look at this example below: @Schema() export class Cat extends Document { @Prop() name: string; } export const catSchema = SchemaFactory.createForClass(Cat); Basically, when you do SchemaFactory.createForClass(Cat) Nest will convert the … Read more

tech