Node.js 我在mongoose中从下面的数据中获取特定的时间段时遇到问题
我有一个json对象,如下所示。但是我想从中获取一个特定的时间段,给定约会日程ID、每日日程ID和时间段ID。我尝试了几个查询,但它们都无法获取特定的时间段。有人能帮我吗 我尝试过使用aggregate、findOne、find和许多序列化参数,比如$elemMatch,$,其余的似乎都不起作用Node.js 我在mongoose中从下面的数据中获取特定的时间段时遇到问题,node.js,mongodb,mongoose,Node.js,Mongodb,Mongoose,我有一个json对象,如下所示。但是我想从中获取一个特定的时间段,给定约会日程ID、每日日程ID和时间段ID。我尝试了几个查询,但它们都无法获取特定的时间段。有人能帮我吗 我尝试过使用aggregate、findOne、find和许多序列化参数,比如$elemMatch,$,其余的似乎都不起作用 { "status": 200, "success": true, "appointment_schedule": { "is_active": true, "_id": "5eb3d9
{
"status": 200,
"success": true,
"appointment_schedule": {
"is_active": true,
"_id": "5eb3d9091547033ad466bba6",
"doctor_id": "5eb1d45f28d6af2430f48d91",
"week": 17,
"year": 2020,
"daily_schedule": [
{
"_id": "5eb3d9091547033ad466bba7",
"date": "2020-05-03T00:16:07.232Z",
"day": "Monday",
"time_slot": [
{
"is_avaliable": true,
"booked_by": null,
"_id": "5eb3d9091547033ad466bba8",
"start_time": "2020-05-03T00:16:07.232Z",
"end_time": "2020-05-03T00:18:07.232Z",
"time_total_seconds": 2345,
"time_total_mins": 345
},
{
"is_avaliable": true,
"booked_by": null,
"_id": "5eb3d9091547033ad466bba9",
"start_time": "2020-05-03T00:19:07.232Z",
"end_time": "2020-05-03T00:21:07.232Z",
"time_total_seconds": 2345,
"time_total_mins": 345
},
{
"is_avaliable": true,
"booked_by": null,
"_id": "5eb3d9091547033ad466bbaa",
"start_time": "2020-05-03T00:21:07.232Z",
"end_time": "2020-05-03T00:23:07.232Z",
"time_total_seconds": 2345,
"time_total_mins": 345
}
]
},
{
"_id": "5eb3d9091547033ad466bbab",
"date": "2020-05-03T00:16:07.232Z",
"day": "Thesday",
"time_slot": [
{
"is_avaliable": true,
"booked_by": null,
"_id": "5eb3d9091547033ad466bbac",
"start_time": "2020-05-03T00:16:07.232Z",
"end_time": "2020-05-03T00:16:07.232Z",
"time_total_seconds": 2345,
"time_total_mins": 345
},
{
"is_avaliable": true,
"booked_by": null,
"_id": "5eb3d9091547033ad466bbad",
"start_time": "2020-05-03T00:16:07.232Z",
"end_time": "2020-05-03T00:16:07.232Z",
"time_total_seconds": 2345,
"time_total_mins": 345
},
{
"is_avaliable": true,
"booked_by": null,
"_id": "5eb3d9091547033ad466bbae",
"start_time": "2020-05-03T00:16:07.232Z",
"end_time": "2020-05-03T00:16:07.232Z",
"time_total_seconds": 2345,
"time_total_mins": 345
}
]
}
],
"createdAt": "2020-05-07T09:46:49.578Z",
"updatedAt": "2020-05-07T09:46:49.578Z",
"__v": 0
},
"message": "Doctor appointment set successfully"
}