Prisma ORM · Prisma Client queries

Delete records

Delete one record, or many with a filter.

await prisma.post.delete({ where: { id: 1 } });
await prisma.post.deleteMany({ where: { authorId: 1 } });

Caution: Deletes are permanent. Check the where filter, because an empty one deletes every row.

Official Prisma ORM documentation

More prisma client queries commands

All prisma client queries commands · Prisma ORM cheatsheet

Was this page helpful?