Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

176
Vistas
How to use wildcard characters in ts TypeORM?

I'm coding a query in my NestTs project, so I would like to retrieve information matched with LIKE clause values.

The problem with my query is the table has three types of records _INFORMED, _UNINFORMED and WITHOUT. If I use the sentence

.where("user.firstName like :name", { name:`%_INFORMED%` })

... It matches with _INFORMED and _UNINFORMED records, then I tried to use the wildcard character as to standard SQL: '%\\_INFORMED%' but it looks wrong.

Do you have any idea? Thanks!

Edit:

Full TYPEORM query:

.createQueryBuilder(Stage, 's')
  .innerJoin('s.stageType', 'st')
  .leftJoin('s.reasons', 'r')
  .select(['s.id', 's.description', 's.name', 'st.id', 'st.name', 'st.displayName', 'r.id', 'r.code', 'r.description'])
  .where('st.name like :INFORMED', {
    INFORMED: '%\\INFORMED',
  })
  .orWhere('st.id = :eMeliKeyword', {
    eMeliKeyword: StageTypesID.DE_MELI_KEYWORD_ID,
  })
  .getMany();
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda