Joseph Mansfield
PPrisma
•Created by Joseph Mansfield on 1/24/2025 in #help-and-questions
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
and a related model like
. A game
has 0 or more like
s related to it. What I want to get: the total number of game
s that have at least 5 related like
s. Ideally I would do this without fetching unnecessary extra data from the database.
Appreciate any help, thanks.3 replies