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
Mongoose: searching via two separate search params

In my routes.js I am attempting to make a new route:

app.route('/dashboard/:userID/:event')
    .get(getEvents)

controller.js file:

export const getEvents = ((req, res) => {
    Gift.find({userID: req.params.userID, event: req.params.event}, (err, user) => {
        if(err) {
            res.send(err)
        }
        res.json(user)
    })
})

When I test the route in postman I cannot pull the data. How do I search via multiple parameters (":userID/:event") e.g. localhost:3000/dashboard/823094809643435/picnic ?


When I had a single dynamic parameter: "/dashboard/:event" , my same controller function pulled the data, but I don't know how to query for two specific params. The goal being that GET requests on event data will be associated with the userID, to make the event name specific to that users event pool.
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!