rogueturnip
rogueturnip
Explore posts from servers
DTDrizzle Team
Created by codefork on 8/18/2023 in #help
Get total row count in select
Count seems like a very common thing that people want. in the findMany query why not have a "with" option for relations? like
with: {
count:true
comments: {
count: true
}
}

This would then return an object instead of array
{
count: 23
posts: [
{
id: ...
...
comments: {
count: 1000
comments: [...]
}
}
]
}
with: {
count:true
comments: {
count: true
}
}

This would then return an object instead of array
{
count: 23
posts: [
{
id: ...
...
comments: {
count: 1000
comments: [...]
}
}
]
}
Just a thought on a future feature that could help out with the many "count" questions I'm seeing (since I'm looking for a nice way too)
7 replies