Hi, I have this time slot array.
"schedule" : {
"monday" : [
{
"_id" : ObjectId("62667b8f77b24028c80d1d3d"),
"startTime" : "12:00",
"endTime" : "2:00",
"price" : 100.01
},
{
"_id" : ObjectId("62667b8f77b24028c80d1d3e"),
"startTime" : "19:00",
"endTime" : "20:00",
"price" : 101.01
}
],
"tuesday" : [
{
"_id" : ObjectId("62667b8f77b24028c80d1d3f"),
"startTime" : "23:00",
"endTime" : "23:59"
}
],
}
I want to filter the array based on the given time slot.
For example, if I provide Monday with the time 19:00. So in that case I want a result whose start time equal to or greater than 19:00
So as per the input, I will get a result
"schedule" : {
"monday" : [
{
"_id" : ObjectId("62667b8f77b24028c80d1d3e"),
"startTime" : "19:00",
"endTime" : "20:00",
"price" : 101.01
}
], }
So the first record of the Monday array will not be shown. because it’s time is 12:00 i.e less then 19:00
So how can filter it using aggregation? can anyone please guide me?
Thanks.