Hi, how can I update a nested relation in prisma, ...
# orm-help
n
Hi, how can I update a nested relation in prisma, I tried something like this:
Copy code
prisma.tablename.updateMany({
  where: { // some id },
  data: { emails: {
    set: [{ id: '<mailto:abdul@email.com|abdul@email.com>' }]
  } }
})
I was getting an error that "emails" field doesn't exist. But it does exist at the prisma level. It also work with 'create' and 'connect' when using the create method.
r
@Nothing. 👋 Unfortunately, relation field updates using
updateMany
are not supported with Prisma. I would suggest following this request for more info. A workaround would be to use
update
for each of the items that you want to update.
prisma green 1
n
Okay, I'll try that and get back here.
👍 1
Thank you @Ryan 🙏
🙌 1