
hey guys, i have this project where user create a post and users can like a post, but now, i cant seem to be able to count the number of likes, it seem like Appwrite did not provide the option to actually count attribute or document
please guys, how do i do this??

For that the best way would be to move the counting up logic into a function
And, if you don't want same user like more than once, then you'll be best creating another collection named likes with relationship to the each post with unique key composed from user id and post id.
Recommended threads
- Query.contains not supported on Cloud?I try to filter a row which contain a string inside a string array column, however I get the following error: ``` {"name":"AppwriteException","code":400,"type"... 
- AI feature by functions?I'm creating a website where, in short, users can index certain genealogical content. In connection with the development of AI, I was thinking about introducing... 
- Unknown usage from one of my databaseI need support help. For more than 2 weeks, i didn't make any requests to my database, but I have noticed huge amount of reads and writes requests: Around 8000... 
