Yes, you make another datatype called “Like”
With a field for Post (Post datatype) and a field for User (User datatype)
When they click like it creates a new Like, sets those two fields. Then later in the future if you want to look at all your liked posts you do Do a search for Like
, constraint User = Current user
, then do :each item's Post
Or to get all the Users that liked a specific post, you do Do a search for Like
, constraint Post = [specific post]
, then do :each item's User
There would be some more logic to check first if a Like exists already but you get the idea ![:grinning_face_with_smiling_eyes: :grinning_face_with_smiling_eyes:](http://forum.bubble.io/images/emoji/twitter/grinning_face_with_smiling_eyes.png?v=9)
Do a search is a serverside database query, where it can narrow down the results with some constraints and deliver a list to the client, and it could be a partial list so as they scroll it can deliver more and more results.
When storing a list, in order to narrow down certain things you want you have to do the :filtered
operator after it, but that is a client side filter so it locks the whole browser (if the list is long or the Things are “heavy” with lots of field) while it downloads and displays all results (could be thousands if they are posts!)
The :filtered
operator is more capable, but you can always have a database search with some constraints then do :filtered
afterwards. You’ll notice search constraints are pretty basic but get the job done most of the time.
EDIT: retyped because I am bad at explaining