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

88
Views
Backend Get Request by Title with a WildMatch

I have a custom API which I have made to search for job roles by title. At the moment, I can only get it if I put the entire string in eg, 'Data Analyst', but I also have roles like 'Data Scientist' and 'Data engineer'.

This is similar to WildWatch in Excel.

E.g my current API by title looks like this:

router.get("/title", async (req,res) => {
  const qNew = req.query.new;
  const qTitle = req.query.title;

  try{
    let roles; 
    if(qNew){
      roles = await Role.find().sort({createdAt: -1}).limit(1)
    } else if (qTitle){
      roles = await Role.find({title: {
        $in: [qTitle],
      },
    });
    }else {
      roles = await Role.find();
    }
    res.status(200).json(roles)
  }catch(err){
    res.status(500).json(err);
  }

} )

But I would love for it to work like this API, from tvmaze:

http://api.tvmaze.com/search/shows?q=You

E.g if i do a GET request for the above, I receive tons of titles, all that contain 'you' in their title.

What's the way to incorporate this function into my express api?

It'll help me extremely as I map out my search functionality.

Thankyou to whoever can provide help!

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!