Support `distinct` in `count()`
## Problem I have bumped into a few cases where I need to do a 'where' filter and get records that are 'distinct', to add pagination I need to do a count query also with a 'distinct' option on 'count()', based on the documentation and experience, I can't use distinct on a count() ``` export type FindManyUserArgs = { where?: UserWhereInput | null orderBy?: Enumerable<UserOrderByInput> | null skip?: number | null after?: UserWhereUniqueInput | null before?: UserWhereUniqueInput | null first?: number | null last?: number | null } ``` ## Suggested solution Can we update count() to support distinct as well? so it would accept the object similar to findMany() ``` export type FindManyUserArgs = { select?: UserSelect | null include?: UserInclude | null where?: UserWhereInput | null orderBy?: Enumerable<UserOrderByInput> | null cursor?: UserWhereUniqueInput | null take?: number | null skip?: number | null distinct?: Enumerable<UserDistinctFieldEnum> } ```
Posted by DregondRahl on Nov 11, 2020, 4:00 PM
Tags
Related issues
- some bike vendor told me that the biggest problem with regular to ebike conversion was that regular bike frames were not strong enough to...
- I think of this as the kiosk economy.
- What a goofy comment.
- There's lots of evidence for positive influences of Caffeine on the body (some negative as well), especially the brain.
- Compose support in WSLc
- [RFC] Roadmap to v2.0
Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments
support (Other)
some bike vendor told me that the biggest problem with regular to ebike conversion was that regular bike frames were not strong enough to...
I think of this as the kiosk economy.
What a goofy comment.
There's lots of evidence for positive influences of Caffeine on the body (some negative as well), especially the brain.
Compose support in WSLc
[RFC] Roadmap to v2.0
[Feature]: Add TurboQuant Support for KV Cache Quantization
Support for AGENTS.md and .agents/skills/, the community has been asking since August 2025
Support `distinct` in `count()`
## Problem I have bumped into a few cases where I need to do a 'where' filter and get records that are 'distinct', to add pagination I need to do a count query also with a 'distinct' option on 'count()', based on the documentation and experience, I can't use distinct on a count() ``` export type FindManyUserArgs = { where?: UserWhereInput | null orderBy?: Enumerable<UserOrderByInput> | null skip?: number | null after?: UserWhereUniqueInput | null before?: UserWhereUniqueInput | null first?: number | null last?: number | null } ``` ## Suggested solution Can we update count() to support distinct as well? so it would accept the object similar to findMany() ``` export type FindManyUserArgs = { select?: UserSelect | null include?: UserInclude | null where?: UserWhereInput | null orderBy?: Enumerable<UserOrderByInput> | null cursor?: UserWhereUniqueInput | null take?: number | null skip?: number | null distinct?: Enumerable<UserDistinctFieldEnum> } ```
Comments (0)
No comments yet. Start the discussion.