How do I perform a count on a relation with a where clause in prisma?

Viewed 230

I have the following query which gives all posts and a count of all comments. Now I'd like to get a count of all comments with the post that have the approved field set to true. I can't seem to figure this out.

prisma.post.findMany({
    include: {
      _count: { select: { Comment: true } },
    },
  });

Thanks for any help.

1 Answers
Related