Skip to content

Query doesn't send me back an empty array. #349

@Jcardo97

Description

@Jcardo97

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);
});
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions