Robert
03/09/2021, 7:42 AMconst count = await db.recipe.count({ where, distinct })
It passes type check but gives me an error
Error: Unknown arg `distinct` in distinct for type AggregateRecipe. Did you mean `select`?
I have a function that optionally takes a distinct
param for instance to select only 1 recipe per author (distinct: 'authorId'
)
The function is paginated so I'd like to know how many total recipes (distinct by authorId) there are in that case!Ryan
03/09/2021, 7:54 AMRyan
03/09/2021, 7:56 AMdistinct
and where
in findMany
and return the length of the items that you found.Robert
03/09/2021, 8:04 AMRobert
03/09/2021, 8:04 AM