Hey, I am also facing this problem, which is quite frustrating given how basic this requirement is. We are looking to query a date based on ISODate mongo type, which is not supported in the n8n query UI. I also tried the approaches above without luck. Lastly, I tried doing an $aggregate function which didn’t work either. My very last attempt was to hardcode the date and I see “no output returned”. This is my query:
{“createdAt” : {“$gt”: “2022-04-11T17:54:14.692Z”}}
I ran it on mongo cli and got the intended result
Best way to fix this is to use EJSON from mongodb itself, so we can type json extended mongo and then before sending request, n8n can convert to EJSON
Adding support for extended JSON here, feat: Add support for extended JSON in mongo node by juandl · Pull Request #12574 · n8n-io/n8n · GitHub , which will solve this problem