UNPKG

nestjs-starter

Version:

Get started for beginners with Nestjs

18 lines (13 loc) 333 B
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document } from 'mongoose'; export type CatDocument = Cat & Document; @Schema() export class Cat { @Prop() name: string; @Prop() age: number; @Prop() breed: string; } export const CatSchema = SchemaFactory.createForClass(Cat);