Hey guys! Is there a way to add where close when ...
# orm-help
o
Hey guys! Is there a way to add where close when doing a _count in findMany
Copy code
await prisma.posts.findMany({
    where: {
      company_id: companyId,
    },
    select: {
      _count: {
        select: {
          post: true,
        },
      },
      post: {
        where: {
          status: "published",
        },
      },
    },
  });
r
@Octal pixel 👋 Unfortunately not, we have a request for this that you can 👍 For now, you would need to use a raw query.
o
Thanks for point that out @Ryan, but seems like the team has no plans of including it the client is it ?
r
I don't have an exact ETA on this one at the moment.
o
Gotcha! But I honestly believe this a good have feature in client, solves a lot of conditionals counts
💯 3