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

143
Vistas
Prisma bulk update items with different data

I need to update some fields, but each item should be updated with different value:

await prisma.tokens.updateMany({
    where: {
        product_id: "123",
      },
      data: {
        contract_address: '0x123456',
        mint_edition: i, // <- `i` should be taken from a loop
      },
})

Is there a way to update many items each with different data?

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

0

As far as I know there is no such functionality, what I would do is splitting it up into 2 separate steps. First, I would get all tokens with getAll({ where: {} }) and then loop over each token and update one at a time with the index from the loop. If you want to make sure that either all tokens update or none, you can wrap everything within a transaction

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