Skip to content

Instantly share code, notes, and snippets.

@talesmgodois
Created September 29, 2020 13:25
Show Gist options
  • Save talesmgodois/8e96e31fba94fb81bd7d5a5fcc1fe865 to your computer and use it in GitHub Desktop.
Save talesmgodois/8e96e31fba94fb81bd7d5a5fcc1fe865 to your computer and use it in GitHub Desktop.
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment