Skip to content

updateMany many-to-many relations #2231

Answered by ryands17
ilya-lopukhin asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @ilya-lopukhin 👋
Did you try writing it like this?

prisma.chat.update({
    where: { id: 1 },
    data: {
      seenBy: {
        connect: [{ id: 1 }, { id: 2 }, { id: 3 }],
      },
    },
})

This will update the seen for all users specified in connect

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ilya-lopukhin
Comment options

Answer selected by ilya-lopukhin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants