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

149
Views
Especificar directamente [$gte] en la URL del cartero hace que Mongoose devuelva un objeto vacío

Cuando pongo esta url {{URL}}api/v1/tours?duration[$gte]=10 en postman console.log(req.query) siempre devuelve {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 devuelve {duration: {}}

Creo que tiene algo que ver con el esquema que estoy usando, pero no puedo entender qué debo cambiar.

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!