Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Count records where number of related records is greater than X - Prisma
P
Prisma
•
14mo ago
•
2 replies
Joseph Mansfield
Count records where number of related records is greater than X
Hey folks
, I
'm struggling to figure out the right way to express a particular query
.
I have a model
game
game
and a related model
like
like
. A
game
game
has 0 or more
like
like
s related to it
. What I want to get
: the total number of
game
game
s that have at least 5 related
like
like
s
. Ideally I would do this without fetching unnecessary extra data from the database
.
Appreciate any help
, thanks
.
Prisma
Join
The official Discord server of Prisma! Find us online at prisma.io
9,819
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Getting total count of records with one Query
P
Prisma / help-and-questions
2y ago
[Prisma] Nested create with 2 levels of related records
P
Prisma / help-and-questions
2y ago
select all related records on create
P
Prisma / help-and-questions
2y ago
How to solve this in Prisma, count related entries of complex query
P
Prisma / help-and-questions
16mo ago