P.S. I see `_count` used in some places and `count...
# orm-help
g
P.S. I see
_count
used in some places and
count
used in other places. What's the difference? should I be using one over the other?
r
I am relatively new to prisma myself, but I do not see
count
used anywhere, I would go with
_count
and see if that helps
g
It does not, I tried both.
r
I had a play with one of my models and this works for me:
Copy code
prisma.area.groupBy({
	by: ["name"],
	_count: { name: true },
	orderBy: { _count: { name: "desc" } },
	having: { name: { _count: { gt: 1 } } },
});
It looks like prisma is using the wrong type, my orderBy prop is of type
AreaOrderByWithAggregationInput
not
AreaOrderByInput
seems like your group by method does not know that it is using aggregation?
g
whoops...I'm an idiot, I was running an old version of prisma (2.2)
guess that's what happens when I use some starter code
thanks for your suggestions!
👍 1