Prisma ORM · Prisma Client queries
Update or create
Update the record if it exists, otherwise create it.
await prisma.user.upsert({
where: { email: "[email protected]" },
update: { name: "Ada" },
create: { email: "[email protected]", name: "Ada" },
});
Official Prisma ORM documentation