import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { HydratedDocument } from 'mongoose'; import { IPerson } from '../../interfaces'; @Schema({ _id: false }) export class Person implements IPerson { @Prop({ type: String, required: false }) pid: string; @Prop({ type: String, required: false }) firstName: string; @Prop({ type: String, required: false }) lastName: string; @Prop({ type: Number, required: false }) gender: number; @Prop({ type: Date, required: false }) birthDate: Date; } export const PersonSchema = SchemaFactory.createForClass(Person); export type PersonDocument = HydratedDocument;