this is my model
const DoctorSchema=mongoose.Schema({
ds:[{day:String,timeSlots:[{time:String,status:Boolean}]}],
hospital:{type:mongoose.Schema.ObjectId,ref:'Hospital',required:true},
city:{type:[String],index:true},
addedAt:{type:Date,default:Date.now}
})
the ds field is the dateslot fields of the doctor. after a patient books a time slot then the status of that time slot of that particular day should be made to false so that no other patient books the same time slot.
the ds field is an array of objects containing day field and timeslots array where time slots are the slots available for a particular day
ds:[{day,that days timeslot array}]