Upvoting and Downvoting, Following, Likes, Bookmarks Functionality

Hi @vishsahu

I am building some Upvoting and Downvoting, Following, Likes, Bookmarks Functionalities in my app. How I have structured these is as follows.
The upvote, downvote, follow, like, bookmark are all fields of type user in their respective Collections.
My question is, how do I setup an event that adds or removes a user from an upvote and from a downvote or from a like…
Here is how i am thinking of it.

  1. If a user clicks on an upvote button (they are added to the list of users who have upvoted that question or answer). if the user clicks the same button (they are subtracted or removed from the list of users who upvoted). This process is directed by some conditions. These are… If the user is not already in the list, add user. if the user is already in the list, remove user. There is also the need to perform a count of these users to then display them as shown in the screenshots below. Included are screenshots of some of the collections.
    I am also searching for ways to capture views (when a question or chatroom is viewed) how to capture those and perform a count.

I am also hoping to capture the count of answers to each question for example.

I hope I am making sense



Hi @WillieMak,

There is a feature called Add to Collection, where you can create a list of people who liked/upvoted it and then add that loggedIn user to that list.

This way you will have the no of people who liked it and their count.


1 Like

Awesome. Thank you so much @vishsahu

@vishsahu . How about the views, would it be the same setup?

Hi @WillieMak,

Yes, view you can set up as you want.

1 Like

Ok. Will try that. Thanks @vishsahu

1 Like