I was trying to create a dynamic connection between mongo DB and make to search VIA timestamps and now have found a working version.
this will allow you to search mongodb for any thing under 2 hours:
{
“$expr”: {
“$anyElementTrue”: {
“$map”: {
“input”: “$messages”,
“as”: “m”,
“in”: {
“$gte”: \[
{ “$toLong”: “$$m.timestamp” },
{{formatDate(addHours(now, -2), “x”)}}
\]
}
}
}
}
}