Hi
I am using an HTTP request module to access MongoDB.
I am trying to filter records based on a date range.
The date field in MDB is called createdAt and it has values like this:
2023-10-19T14:12:56.791+00:00
I cannot retrieve any data.
This is my debug query:
{
“database”: “{{1.MONGO_DB}}”,
“dataSource”: “{{1.MONGO_DATASOURCE}}”,
“collection”: “userEvent”,
“filter”: {
“createdAt”: “2023-10-19T14:12:56.791+00:00”
}
}
This returns no documents and yet the date has been lifted directly from MDB.
I have tried to parse the date in make.com
{{parseDate(“2023-10-19T14:12:56.791+00:00”; “YYYY-MM-DDTHH:mm:ss.SS”; “GMT”)}}
But the output of this looks like this: 2023-10-19T14:12:56.791Z
This does not work I am guessing because of the Z which make.com inserts
I tried this too: {{parseDate(“2023-10-19T14:12:56.791”; “YYYY-MM-DDTHH:mm:ss.SS”; “GMT”)}}, same problem
Any ideas plse?
Thx
Ian
PS I am assuming once i crack this i can use $gte and $lt for my date range.