Tom MacWright
10/21/2021, 8:20 PMdeleted
column in posts and only want to count the non-deleted posts? https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#include-a-_count-of-relationsAustin
10/21/2021, 8:34 PMconst count = await prisma.post.aggregate({
_count: true,
where: { deleted: false }
})
Tom MacWright
10/21/2021, 8:36 PMTom MacWright
10/21/2021, 8:36 PMTom MacWright
10/21/2021, 8:38 PMin
could maybe express this in 2 queries, but seems hackyAustin
10/21/2021, 8:49 PM$queryRaw
) to get that specific result. If you are interested in seeing filtering on relation counts, please add your use case/+1 on this feature request.