From b1d56efcd1bb816b101bf3bfd518d4fd0aaa7566 Mon Sep 17 00:00:00 2001 From: Anand Suthar Date: Wed, 3 Jul 2024 18:45:53 +0530 Subject: [PATCH] refactor : removed explicit declaration of _id field from Mongoose schemas --- app/models/bookedAppointment.ts | 1 - app/models/commonDisease.ts | 1 - app/models/doctor.ts | 1 - app/models/hospital.ts | 1 - app/models/medicalHistory.ts | 1 - 5 files changed, 5 deletions(-) diff --git a/app/models/bookedAppointment.ts b/app/models/bookedAppointment.ts index f5174526..59bd7de8 100644 --- a/app/models/bookedAppointment.ts +++ b/app/models/bookedAppointment.ts @@ -19,7 +19,6 @@ export interface BookedAppointment extends mongoose.Document { const bookedAppointmentsSchema = new mongoose.Schema( { - _id: { type: mongoose.Schema.Types.ObjectId, required: true }, date: { type: Date, required: true }, timing: { type: String, required: false }, state: { type: String, required: true }, diff --git a/app/models/commonDisease.ts b/app/models/commonDisease.ts index af885a36..3c25b6a1 100644 --- a/app/models/commonDisease.ts +++ b/app/models/commonDisease.ts @@ -6,7 +6,6 @@ export interface CommonDiseases extends mongoose.Document { const diseaseSchema = new mongoose.Schema( { - _id: { type: mongoose.Schema.Types.ObjectId, required: true }, commonDiseases: [String], }, { diff --git a/app/models/doctor.ts b/app/models/doctor.ts index a11820d3..7222dda3 100644 --- a/app/models/doctor.ts +++ b/app/models/doctor.ts @@ -36,7 +36,6 @@ const addressSchema = new mongoose.Schema({ const doctorSchema = new mongoose.Schema( { - _id: { type: mongoose.Schema.Types.ObjectId, required: true }, firstname: { type: String, required: true, diff --git a/app/models/hospital.ts b/app/models/hospital.ts index 6c2a05ee..69c0c55e 100644 --- a/app/models/hospital.ts +++ b/app/models/hospital.ts @@ -27,7 +27,6 @@ export interface Hospital extends mongoose.Document { const hospitalSchema = new mongoose.Schema( { - _id: { type: mongoose.Schema.Types.ObjectId, required: true }, firstname: { type: String, required: true, diff --git a/app/models/medicalHistory.ts b/app/models/medicalHistory.ts index 9236510a..76f5bc61 100644 --- a/app/models/medicalHistory.ts +++ b/app/models/medicalHistory.ts @@ -12,7 +12,6 @@ export interface MedicalHistory extends mongoose.Document { const medicalHistorySchema = new mongoose.Schema( { - _id: { type: mongoose.Schema.Types.ObjectId, required: true }, hospital: { type: mongoose.Schema.Types.ObjectId, ref: "Hospital",