Nichita Z
06/22/2021, 9:22 AMmodel 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?Ryan
06/22/2021, 9:29 AMNichita Z
06/22/2021, 9:31 AM