Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

150
Views
Directly specifying [$gte] in the postman url causes Mongoose to return an empty object

When I put this url {{URL}}api/v1/tours?duration[$gte]=10 into postman console.log(req.query) always returns {duration: {}}

exports.getAllTours = async (req, res) => {
  try {
    const query = Tour.find(req.query);
    console.log(req.query);
    const tours = await query;

    res.status(200).json({
      status: 'success',
      data: { tours },
    });
  } catch (err) {
    res.status(404).json({
      status: 'fail',
      message: err,
    });
  }
};

req.query returns {duration: {}}

I think it has something to do with the schema I am using but I cannot figure out what I need to change

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!