Open kennyboy55 opened 6 months ago
Hi. Unfortunately, docs are explicitly saying that you cannot use count
when filtering by the properties of the base model.
Aggregating with "sum", etc. doesn't work with fields from delegate base because Prisma doesn't allow using a relation field to aggregate. However, "_count" seems to be a special one and it may actually work ...
I'll check for details and comment back soon.
Description and expected behavior I have a zmodel with inheritance. The base has a one to many relation. When quering the child, I am trying to use _count. However, it tries to find the relation in the child instead of the parent.
Environment (please complete the following information):
Additional context The model
The code
The error