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

297
Vistas
NestJS TypeORM How to correctly type the OR conditional in a query?

I currently have this code to get my results

rolesCanAssign = await this.rolesRepository.find({
            

where: {
    VALCompany: user.VALCompany,
},

But I need to add an OR operator to this WHERE and I wanted to do it like this

where: [{VALCompany:user.VALCompany},{isNull(VALCompany)}]

I get an error saying I was expecting a '{'. So for the moment use the following but I would like to type it like the previous example

code that currently works for me:

where: 'VALCompany IS NULL or VALCompany IN (' + user.VALCompany + ')'
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The problem is in the second part, you should do:

where: [{VALCompany:user.VALCompany},{VALCompany:isNull()}]
about 4 years ago · Juan Pablo Isaza Denunciar
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