katoikia-app/service-a/src/books/schemas/book.schema.ts

27 lines
438 B
TypeScript
Raw Normal View History

2022-06-29 02:30:10 +00:00
import { Schema, Prop, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';
export type BookDocument = Book & Document;
@Schema()
export class Book {
@Prop()
genre: string;
@Prop()
description: string;
@Prop()
author: string;
@Prop()
pages: number;
@Prop()
image_url: string;
@Prop([String])
keywords: string[];
}
export const BookSchema = SchemaFactory.createForClass(Book);