I have data in the ISOdate format in MongoDB. When I run the query in mango shell it works correctly.
But the same query when I used in nodejs it gives an error
USED IN NODEJS
router.get("/api/status/:id0/:id1",async(req,res)=>{
..........
..........
db.collection.aggregate([
{$match:
{"time": {
"$gt": req.params.id0,//req.params.id0.toISOString()
"$lt": req.params.id1}
}
},
{$group:
{
_id: "$fb_id",
active:"$status"
}
}
]);
URL
localhost:3011/status/"2019-12-15T09:19:57.216071"/"2019-12-16T09:25:03.508605"
or
localhost:3011/status/2019-12-15T09:19:57.216071/2019-12-16T09:25:03.508605
0r
localhost:3011/status/%222019-12-15T09%3A19%3A57.216071%22%2F%222019-12-16T09%3A25%3A03.508605%22%0D%0A
Still not fetch value