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

187
Vistas
TypeORM - appending new items to array-type column (Postgres)

Postgres supports array type columns, and exposes methods for working with those arrays (like array_append). I'm wondering if TypeORM allows using those methods somehow.

In case it's not supported, what do you think the best way to append items to PG array? Doing something like get-and-set? (a transaction of getting the value, creating the new new array with js, and updating the value in the DB)

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use native Postgres methods like array_append if you use the TypeORM Query Builder.

Example below:

await dataSource.createQueryBuilder()
  .update(User)
  .set({
    yourArrayColumn: () => `array_append("yourArrayColumn", 1)`
  })
  .where("id = :id", { id: 1 })
  .execute();

More about using TypeORM Query Builder for updates: https://typeorm.io/update-query-builder

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