Shows incorrect count number by using selectRelationCount previewFeatures
See original GitHub issueI have a list of posts and each post has multiple comments. I was counting the total comments that each post has. Using selectRelationCount
previewFeatures, its count number is correct but it shows different references. like:
post id 1
has 2
comments
post id 2
has 4
comments
post id 3
has 0
comment
post id 4
has 0
comment
query result shows:
post id 1
has 0
comments
post id 2
has 0
comments
post id 3
has 4
comment
post id 4
has 2
comment
Query:
..
select: {
...select.select.posts.select,
_count: {
select: { comments: true }
}
}
.
.
const posts = await prisma.post.findMany(opArgs);
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:6 (3 by maintainers)
Top Results From Across the Web
count self relation on Prisma error: table name specified more ...
This is a known issue with self-relations and we hope to fix it soon. If you want to track this bug, follow this...
Read more >Prisma 2.30.0 Release - GitClear
These scenarios tend to show up often for developers using the ... Shows incorrect count number by using selectRelationCount previewFeatures · JSON number ......
Read more >What's new in Prisma? (Q3/2021)
Select Relation Count allows you to count the number of related records by passing _count to the select or include options and then...
Read more >prisma argument of type whereuniqueinput needs at least one ...
I'm trying to implement resolver which will check if the user with given login exists in the database. But I have a hard...
Read more >Prisma-whats-new - Linen
generator client { provider = "prisma-client-js" previewFeatures ... You can find out more about implementing use cases with transactions in the docs, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Have the similar problem here, even without using
skip
orcursor
Schema:
Query:
Result (attention to groups with id 12 and 14):
Can you open a separate issue please @mart2967 and provide all the information the issue template asks for? Thanks.