I have documents that associated to students:
[
{
'_id': 1,
'name': 'Anna',
'vacation_start: '2024-01-01',
'vacation_end': '2024-01-03'
},
{
'_id': 2,
'name': 'Bob',
'vacation_start: '2024-01-01',
'vacation_end': '2024-01-05'
},
{
'_id': 3,
'name': 'Zenna',
'vacation_start: '2024-02-02',
'vacation_end': '2024-02-10'
}
]
How can i get students that only available from my input to my input?
For example my input: available_from=2024-01-04
available_to=2024-02-02
And i want to get only Anna in this filters.
I was thinking about $gt and $lt but i do not think that this is the right way