Update mongoose schema based on time

#1

I have Two Schema one for Doctor and another for the patient.
The doctor has a time table for an example Doctor check patient between 10 am - 1 pm.
let assume patient get an appointment at 11 am, But he unable to reach there. Now I want at 2 pm user booking object update.
patient = [{
_id: ObjectId
name: Suraj,
booking:[{
doctor: {type: Schema.Types.ObjectId, ref: ‘Doctor’},
appointmentdate: 12-6-2019,
appointmentdate: 11am
}],
history:[{
doctor: {type: Schema.Types.ObjectId, ref: ‘Doctor’},
appointmentdate: 12-6-2019,
appointmentdate: 11am
}]
}]

doctor =[{
_id: ObjectId
name: banti,
booking:[{
patient: {type: Schema.Types.ObjectId, ref: 'Patient'},
appointmentdate: 12-6-2019,
appointmentdate: 11am
}],
timetable: 10am - 1pm
}]

I don’t know where to start please guide me.
Or in case you don’t understand my question or logic then, please comment out which part you don’t understand

#2

This forum is about Mongoose OS - an IoT Firmware Development Framework

closed #3