I want to check if rows referencing that particula...
# orm-help
h
I want to check if rows referencing that particular arbitrated row with given session_id exists in stat table.
r
Could you share your schema?
h
Copy code
model arbitrated {
  id Int @id @default(autoincrement())
  session_id String @unique
  stat stat[]
}

model stat {
  id Int @id @default(autoincrement())
  arbitrated arbitrated @relation(fields: [arbitratedId], references: [id])
  arbitratedId Int
}
Yeah, sorry for forgetting that 😄
Any idea why this is not working?
r
The syntax was incorrect:
Copy code
await prisma.stat.count({
    where: { arbitrated: { session_id: 'session-id' } },
  })
I would suggest using
ctrl+space
when in VSCode to see what can be passed under
arbitrated
.