I'm saving user "Likes" as a relation to Post objects, just like in the docs.
$user = ParseUser::getCurrentUser();
$post= new ParseObject("Post", $the_post_id);
$relation = $user->getRelation("likes");
$relation->add($post);
$user->save();
This works fine so far.
Now I'm wondering how to query the Posts and also pull a Count of how many users liked each post. I don't want to run separate queries in a loop for each Post.
I would also like to know if the CurrentUser likes each post in the query as well. Again, definitely want to avoid making multiple queries in a loop.
Is this possible?
My Current Post Query:
$query = new ParseQuery("Post");
$posts = $query->find();