I've encountered an issue with my mongo query when attempting to retrieve records based on the current time. Despite trying to filter by date and time, the query consistently returns 0 results. The specific query causing trouble is shown below:
let now = momenttz.tz(moment(),tz).toDate();
tmpl.listSelectorFilter('scheduledVisits', {
$gte: now,
$lte: moment.utc(today, 'MM/DD/YYYY').endOf('week').toDate()
});
It's worth noting that setting the time to zero hours seems to resolve the problem.
Can someone advise me on how to modify this query to ensure it functions correctly? Any assistance would be greatly appreciated.