I use the parameter type date in a query “$date”: “{{begindate}}”, but get an error, because the server expects a date in the format: 2018-02-26T00:00:00.000Z, but the date format is: 2018-02-26.
Is there any way to convert the date in the aggregation pipeline?
The error I get is:
Error running query: Invalid query format. The query is not a valid JSON.
This site is in read only mode. Please continue to browse, but replying, likes,
and other actions are disabled for now.
{
"collection": "data",
"aggregate": [
{
"$match": {
"createdAt": {
"$gte": {
"$date": "{{date}}"
}
}
}
}
]
}
Error running query: Invalid query format. The query is not a valid JSON.