This might be off-topic I hope you guys could help me with this I have a thread and I want to validate it by user upvotes kinda like yt how would I validate, assuming it's a function that has a list of users? and what is the right way to query the number of votes
As of now, Appwrite's doesn't support any aggregation function, you can follow (and upvote it <a:agooglethumbsup:635256484682530825>) this issue to track it.
As for your solution, the best would be to create an atomic counter fields for each of the questions/answers/votable posts.
Like so, for example, in case of posts.
- Create collection named
postswith this attributes.
- title
- content
- votes
- Create collection named
voteswith this attributes.
- user_id
- post_id
- Then create a function and make it to be triggered on any change to the
votescollection, so when the a documents is being add increase the value ofposts.votesattribute, and when it got deleted decrease it.
This way you can have counters without having the need to query all the documents every time.
I see tyvm
[Answered] Validating a vote system with appwrite /nosql?
[Solved] Validating a vote system with appwrite /nosql?
Recommended threads
- Excessive usage of cloud functions is sl...
I have made almost all my requests through cloud functions and jwt , due to security fears of a user editing a field he is not supposed to . This unfortunately...
- Using Binary Log with Appwrite
If I can remember correctly appwrite uses mariaDB as the underlying database. If so could I use mariaDB’s binary log to see database operations from appwrite?
- Dart Runtime as Function is missing
Hey guys, I set the _APP_FUNCTIONS_RUNTIMES to dart-3.10 and redeployed the appwrite stack but unfortunately the dart runtime doesnt show up. I copied the val...