Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

90
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda