Current section: Updating Data 6 exercises

Deleting Data with Prisma


00:00 Like I said, it's going to be kind of easy. So let's do no ID here, come down to delete, and instead of DB, it's going to be Prisma, and you're going to await, and we're going to use the syntax or the API from Prisma here, and that's it. We're done. We can remove the DB from here now,

00:17 and now delete will work. Boom, it's gone. Awesome. So that is delete with Prisma. You literally just say Prisma, here's my model that I want to delete from, here's the delete, and here's my where clause. You also have delete many. So if your where clause applies to like,

00:36 I want to delete all of this user's login sessions or something like that, you got a table for that or whatever, then yeah, you use delete many. We'll be doing that in our op workshop later. So yeah, there is a little bit more to it, I suppose, but yeah, deleting, pretty straightforward.