Error: No records (needed to disconnect existing child records) were found for a nested set on many-to-many relation #24228
-
QuestionI have an implicit many-to-many relation between two tables: When a record in the
How to reproduce (optional)No response Expected behavior (optional)I would expect Information about Prisma Schema, Client Queries and Environment (optional)model Profile {
id String @id @default(cuid())
paymentMethods PaymentMethods[]
}
model PaymentMethods {
id String @id @default(cuid())
name String @unique
profiles Profile[]
} prisma.profile.update({
where: { id },
data: {
paymentMethods: {
set: [{id: "existingPaymentMethodId1"}, {id: "existingPaymentMethodId2"}],
},
}
}); prisma : 5.8.1 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Also note that this is the same that is found in this example from the docs |
Beta Was this translation helpful? Give feedback.
-
I made a very stupid mistake where the |
Beta Was this translation helpful? Give feedback.
I made a very stupid mistake where the
id
in thewhere
clause was not correct and was not even related to an existingProfile
record.