-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Prisma has a nested set operation to connect the provided relations while disconnecting previous ones.
It is not very well documented, the only reference I found apart from the type definitions is this: https://www.prisma.io/docs/orm/prisma-client/queries/relation-queries#disconnect-all-related-records
Disconnect all related records
To disconnect all related records in a one-to-many relation > (a user has many posts), set the relation to an empty list as shown:
const result = await prisma.user.update({ where: { id: 16, }, data: { posts: { set: [], }, }, include: { posts: true, }, })
The library is currently missing the nested set operation.
Metadata
Metadata
Assignees
Labels
No labels