I need to include `count` of the realtion using `f...
# orm-help
s
I need to include
count
of the realtion using
findMany
r
Hey @Sijad, you would have to use the
count
method separately along with
findMany
. Something like
prisma.user.count()
Count accepts the same params as
findMany
so that will work for you in this case
Let me know if it works!
s
hey @Ryan thanks for your answer
👍 1
I need to get
count
for my 1-n relation, if I perform
count
for each items I'd end up with 1+n queries
I wish there were a way to do that
r
Could you provide me with an example for your use-case?
s
i have one products which have relations with orders (1:n) i want to fetch all of my products and also show how many times it bought by counting its orders