I have a problem comparing Dates in Retool when querying MongoDB.
I have a date_created type Date field. I need to get the data between the start and end dates.
I make a query:
finde(
{
"date_created":{
$gte: {{new Date(dateRange1.value.start).toISOString()}}
$lt: {{new Date(dateRange1.value.end).toISOString()}}
}
}
)
But I get an empty result. Not a single line fits this range. I checked, the strings are exactly there. But the comparison fails. What could be the problem?