I am using Data API (Postman tool) to query records from my collection. But when I am trying to add datetime filter for the same, I am not able to figure out the correct syntax, I tried multiple syntaxes but nothing seems to work.
my Input Query:-
{
"collection":"Events",
"database":"PDC",
"dataSource":"PDCCluster",
"filter":
[{"pxCommitDateTime":{<:ISODate("2020-04-17T08:50:15.000+00:00")}}]
}
I have to do something like
Select * from Events where pxCommitDateTime < “” And pxCommitDateTime > “”
Please help.
Hello @Priyabrata_Nath ,
Welcome to The MongoDB Community Forums!
Please check below thread as a similar issue has been resolved there.
Hi guys, I’m having difficulty using the $gte ISOdate function in a filter VIA the api. Can you help?
The error I get is “Invalid syntax error: TypeError: invalid character ‘I’ looking for beginning of value”
This is the end point I’m using: /endpoint/data/beta/action/find
this is the JSON:
{
"dataSource":"Cluster0",
"database":"v1",
"collection":"pipedriveDeals",
"filter": {
"wonDate":{
"$gte":ISODate("2022-04-01")
}
}
}
Regards,
Tarun