Nested relation filter
Hi, I'm using Convex for a new side project (mostly for learning so nothing serious) and I'm making a table that have some columns that need to be computed based on relations.
For example:
Table with users and the total of posts and the total of comments. The admin should be able to filter based on the number of comments.
I made initially using the .paginate and then computed the values but what happen when need to filter based on 100+ comments, or 100 comments marked as spam, or 100 comments marked as spam this month on posts related to "Convex" for example?
I know about the denormalization method or the recently new aggregate component, but both seems to get really complex that some point.
With SQL will be like:
I know, this is inefficient AF and will take may be some seconds to resolve but is at least possible.
I don't know if may be there is another way without using denormalization or the aggregate component?
1 Reply
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!