Is this accurate? The TypeScript shows I could do ...
# orm-help
d
Is this accurate? The TypeScript shows I could do stuff like:
Copy code
prisma.model.update({
  where: {
    id: 10
  },
  data: {
    array: {
      push: [1,2,3,4]
    }
  }
})
The above would presumably push 4 numbers onto the array on my model. The documentation says otherwise below
1
n
Hi David 👋 Thanks for bringing this up. I quickly tested this and indeed you can push multiple items, the documentation seems to not have been updated. I’ll let the team know 👍 Here’s the script through which I tested.
Copy code
import { PrismaClient } from '@prisma/client';

const prisma = new PrismaClient({
  log: ['query', 'info', 'warn'],
});

async function main() {
  await prisma.test.create({
    data: {
      array: ['1'],
    },
  });

  await prisma.test.update({
    where: {
      id: 1,
    },
    data: {
      array: {
        push: ['2', '3'],
      },
    },
  });
}

main()
  .catch((e) => {
    throw e;
  })
  .finally(async () => {
    await prisma.$disconnect();
  });
fast parrot 2
prisma cool 2
💯 2