In MongoDB node unable to Query data based on Date Field

Hi Team,

I am unable to query data in mongoDB node using data field.
Earlier I have tried following query techniques to filter the data-


Finally, I found a method to use “$expr” in one of the community threads, which was working fine until someday back for the same query, I am receiving the following error.




{"$eq":["$checkInDate",{ "$dateFromString": { "dateString": "2022-11-06T00:05:00.000Z"}}]},




Error Message -

Can someone please help out with this.

PS: There has been multiple threads on community complaining about the similar issue


@jan @MutedJam @Jon
Can anyone please help me out with this.


Hi @Mustafa_Ali, please do not at-mention folks on the forum if you simply have a new question. Things are really busy at the moment, so we can’t attend to each post straight away. I’ll still try to look through all posts without replies when I have the chance.

That said, it’d be tremendously helpful if you would provide the information requested in the question template on the forum rather than just deleting it. In particular sharing an example workflow using which your problem can be reproduced and confirming the exact version of n8n you are running would be helpful. Seeing you are having trouble with a database you might also want to describe how exactly your data looks like.

Lastly, since you mentioned this worked in the past, can you please confirm what has changed between the working and not working state? Did you upgrade n8n or your database? If so, from which version did you upgrade and which version are you running now?

Hi @Mustafa_Ali, I tried finding the below dataset from MongoDB:


This works fine using the below workflow on [email protected] which queries the created_at date field from my example:


So, it’d be good to understand what exactly is needed to reproduce your problem (specifically MongoDB version, n8n version, workflow, data structure).

If you’re using another n8n version than 0.201.0 you could also try upgrading first to verify whether this resolved the problem.