In my parse database I have a classed called Post and Like. Should I create a field likes in Post class with Relation<Like> type or there is another better option of storing likes in Parse DB?


For those purpose, I only use relations in the USER table with users ids stored as pointers inside.

Using a cloud code function, I provide a parameter to add , del or whatever instructions to apply to a single or an array of users. Cloud gives the opportunity to create collateral events such as "a user like this"

As a reading step, a query is applied to the relation to retrieve parts or all users.

The column is named with the purpose such as I will add 2 columns to mention respectively "like" , "dontLike"

However, if one need more than a single information , a second table needs to be created and linked also with a relation. For example, a new table with a first column which is a regular pointer to users, other columns to stored the additional attributes. Which means that this new table must be first saved, to be able to stored its id in the relation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.