docs icon indicating copy to clipboard operation
docs copied to clipboard

Document filteredCountRelation (Filter in _count selection set)

Open andrew-walford-prisma opened this issue 2 years ago • 1 comments

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

Engineering notes

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.

andrew-walford-prisma avatar Jul 13 '22 08:07 andrew-walford-prisma

This has been held back to 4.2.0. The docs are ready - see the linked PR.

andrew-walford-prisma avatar Jul 19 '22 09:07 andrew-walford-prisma