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

115
Visualizações
$regex in mongodb pipeline

I want to be able to use $regex to be able to find any words that contain certain keyword given by user, but it is not working. I have this:

aggregatePipeline.push({
      $match: {
        name: {
          $regex: `/${name.toLowerCase()}/`,
        },
      },
    });

I tried using $regexMatch, but it says it is not supported for free tier. Is there a work around?

{
      $regexMatch: {
        input: "$name",
        regex: `/${name}/`,
      },
}

I'm trying to avoid $regexMatch at least for now due to free tier.

I am able to retrieve user by the exact name, but I also want to retreive all names that have a substring ex. 'ger', should retrieve 'Gerry', 'Gerald', 'anger'....

aggregatePipeline.push({ $match: { name: name.toLowercase() } });

Thanks a lot!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

{ 'search field': { $regex: new RegExp('search name', 'gi') } }

about 4 years ago · Juan Pablo Isaza Relatório
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