docs
docs copied to clipboard
Document filteredCountRelation (Filter in _count selection set)
Current status: done and tech-reviewed. We just need the URL of the feedback ticket (when client team create it) so we can link to it.
Update 11-aug-2022: No feature changes for 4.3, so the doc is still good to go, with the caveat above - we need the feedback ticket.
SME: Flavian
The Prisma Client currently provides a way to count the number of records connected to a relation. This works on one-to-many (one2m) and many-to-many (m2m) relationships.
Unfortunately though, it is currently only possible to count all connected records.
This new feature is about allowing users to filter on the count of a relation. See engineering notes for full details.
- https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#select-a-_count-of-relations
- https://www.prisma.io/docs/concepts/components/prisma-client/aggregation-grouping-summarizing#count-relations
- Also preview features page - add
filteredRelationCount
.
This has been held back to 4.2.0. The docs are ready - see the linked PR.