Skip to content

Instantly share code, notes, and snippets.

@royib
Created January 19, 2022 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save royib/8d1ac8dad94309fee57bf59fe8a3909e to your computer and use it in GitHub Desktop.
Save royib/8d1ac8dad94309fee57bf59fe8a3909e to your computer and use it in GitHub Desktop.
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
export type GenreDocument = Genre & Document;
@Schema()
export class Genre {
@Prop({ required: true, unique: true })
name: string;
}
export const GenreSchema = SchemaFactory.createForClass(Genre);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment