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
posts
with this attributes.
- title
- content
- votes
- Create collection named
votes
with this attributes.
- user_id
- post_id
- Then create a function and make it to be triggered on any change to the
votes
collection, so when the a documents is being add increase the value ofposts.votes
attribute, 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
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...
- What Query's are valid for GetDocument?
Documentation shows that Queries are valid here, but doesn't explain which queries are valid. At first I presumed this to be a bug, but before creating a githu...
- Unauthorized Charge After Appwrite Pro F...
I was using Appwrite Pro credits worth $100, which were valid until November. During this period, I was exploring Appwrite's services. However, I recently notic...