Back

How to create a Counter

  • 0
  • Databases
  • Flutter
Zionnite
29 Jan, 2024, 03:08

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??

TL;DR
Developers are asking for help on how to count the number of likes in a post using Appwrite. They mention that Appwrite does not provide an option to count attributes or documents. One suggestion is to move the counting up logic into a function. Another suggestion is to create another collection called "likes" with a relationship to each post using a unique key composed of the user ID and post ID. No solution is provided in the thread.
Binyamin
29 Jan, 2024, 03:33

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.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more