我的模式
customer : {
type: Schema.Types.ObjectId,
ref: 'Customer'
},
doctor: {
type: Schema.Types.ObjectId,
ref: 'Doctor'
},
return_patient : {
type: Boolean,
default: false
},
consultation: {
type: Number, //1: Phone, 2: Video
required: true
},
fee: {
type: Number
},
payment: {
type: Schema.Types.Mixed
},
schedule_date: {
type: Date
},
schedule_time: {
from: {
type: String
},
to: {
type: String
}
},
现在我要检查医生的可用性 来自req.query
localhost:9000/api/appointment/doctor-available?doctor=5e83704aadca4064368ff24f&date=2020-04-01&from=5.30&to=6.00
匹配表并查询是否有数据意味着否则医生将不可用 有医生