Created
November 18, 2020 20:59
-
-
Save baharalidurrani/24bd92780df35238f3cd2a6ff4ca3ab8 to your computer and use it in GitHub Desktop.
Center Model having an array of ObjectIds of Physician Models
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; | |
import { Document, Types } from 'mongoose'; | |
import { ICenter } from 'src/types'; | |
import { Physician } from '.'; | |
export type CenterDocument = Center & Document; | |
@Schema() | |
export class Center implements ICenter { | |
@Prop() | |
ip: string; | |
@Prop() | |
password: string; | |
@Prop() | |
salt: string; | |
@Prop({ type: [Types.ObjectId], ref: Physician.name }) | |
physicians: Physician[]; | |
} | |
export const CenterSchema = SchemaFactory.createForClass(Center); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment