• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

854
Vistas
NestJS: Case-insensitive search in PostgreSQL

Is there any way to do a case-insensitive search with NestJS in PostgreSQL?

I've succeeded in doing a case-sensitive search:

let result = await myRepository.findOne({firstName: fName, lastName: lName});

I'm trying to change it to a case-insensitive search.

about 3 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The ILike option should work for that:

import {ILike} from "typeorm";

const loadedPosts = await connection.getRepository(Post).find({
    title: ILike("%out #%")
});

Example from https://typeorm.io/#/find-options/advanced-options


For ILIKE in Postgres see https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-LIKE

The key word ILIKE can be used instead of LIKE to make the match case-insensitive according to the active locale. This is not in the SQL standard but is a PostgreSQL extension.

about 3 years ago · Santiago Trujillo 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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda