I have used following code in “Modified JavaScript value”
var startOfToday = new Date();
startOfToday.setHours(0, 0, 0, 0);
var endOfToday = new Date();
endOfToday.setHours(23, 59, 59, 999);
var isoStartOfToday = startOfToday.toISOString();
var isoEndOfToday = endOfToday.toISOString();
The variables are created and displaying when logging. But when using the MongoDB Input method and querying using JSON code and writing the following code it`s not working.
{
"createdOn": {
"$gte": { "$date": "${isoStartOfToday}" },
"$lt": { "$date": "${isoEndOfToday}" }
}
}
Log:
startOfToday = 2024/07/22 00:00:00.000
endOfToday = 2024/07/22 23:59:59.999
isoStartOfToday = 2024-07-21T18:30:00.000Z
isoEndOfToday = 2024-07-22T18:29:59.999Z
When I put these values statically I get the response correct.