```model User { id Int @id @default(...
# orm-help
i
Copy code
model User {
  id         Int     @id @default(autoincrement())
  name       String?
  followedBy User[]  @relation("UserFollows", references: [id])
  following  User[]  @relation("UserFollows", references: [id])
}
Hi people, I found this part on the documentation, but I don't really get how I can just simply let a User follow and unfollow a User. What does the code have to look like?
a
Hey Ignace! You would most likely use the
connect
and
disconnect
APIs to do so. Here’s an example of unfollowing a given user:
Copy code
await prisma.user.update({
    where: { id: someUserId },
    data: {
      following: {
        disconnect: {
          id: userIdToUnfollow
        }
      }
    }
  })
This will “unrelate” a given user, removing it from a user’s
following
list. You can read more in our docs, but let me know if you have more questions!