Hi all, I got a question regarding m-n-relations i...
# orm-help
n
Hi all, I got a question regarding m-n-relations in prisma.. letโ€™s say I got this model
model Test {
id              Int       @id @default(autoincrement())
pendingFollowers Test[] @relation(name: "relation")
pendingFollowing Test[] @relation(name: "relation")
}
And I want to check if Test(id 1) has a specific Test(id 10) in its pendingFollowing list:
const user = await this.prisma.test.findFirst({
where: {
id: 0,
pendingFollowing: {
some: {
id: 10
}
}
}
})
This is the best way I could find, but it feels.. a bit weird, is this the standard way of doing this?
r
@Nichita Z ๐Ÿ‘‹ Yes this is the standard way of doing this ๐Ÿ™‚
n
Okay, just wanted to make sure! Many thx as always
๐Ÿ™Œ 1