Query doesn't send me back an empty array.
Hi guys! I need help. I'm trying to make a query, but the array is empty and I can not see the error in my code. The data is getting right to the back end and if I use the same data in a direct query from the mongo shield if I return the data. I appreciate any help you can give me.
I attach my code
router.get('/tasks/:date1/:date2', (req, res, next) => { console.log(req.params.date1); console.log(req.params.date2); db.studentServices.find({ "Fecha" : {$gte: req.params.date1, $lte : req.params.date2}}, (err, studentService) => { if(err) return next(err); console.log(studentService); res.json(studentService); }); });
Could you provide some data as well as the console log output for a certain scenario given date1 and date2

Yes no problem, use date in epoch format because it is more easy to save the date.
https://ufidelitas.ac.cr/assets/en/Josue/2018-04-10_12-51-25.png
In that URL we can see output from date1 (date begin) and date2 (date end) and empty array.
In another site i make a request from all the information in the collection and send me back all information with date . Attached URL with Image
https://ufidelitas.ac.cr/assets/en/Josue/2018-04-10_12-54-29.png

and whem I use that information to make a consult directly from database it work´s.
Thanks for help.