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

226
Vistas
Use array for filtering Prisma nextjs

having an array with unique names, how can i update the elemets of those names using prisma(in nextjs). I mean something Like:

const arr=['Joe', 'Mark'];
const update=await prisma.user.updateMany({
    where: {
        name: //What should i put to update both Joe and Mark?
    },
    data: {
        notifications: {push: "Hello"}
    }
});

I'm using PSQL and i don't know if it matters.

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

0

Try this:

const arr=['Joe', 'Mark'];

const update=await prisma.user.updateMany({
    where: {
        name: {in: arr}
    },
    data: {
        notifications: {push: "Hello"}
    }
});

"in" will check if name matches anything in that array. Here is the list of other filters: https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#filter-conditions-and-operators

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