I'm using Parse as my backend and I'm currently looking for a better way for my situation.
I'll use Objective-C in order to demonstrate but I didn't tag it as Objective-C because it's not language related.
My situation is as follows: I have a class let's call it X. that has a key let's call it Y which is PFRelation of type Z (Y<Z>).
I need to get a list of Z. like to query for Z (Z is all I'm interested in).
Moreover, if possible, I want to be able to limit the output of Z like PFQuery does.
To sum up: I need a PFQuery that will be able to do all the abilities of PFQuery e.g. findObjectsInBackgroundWithBlock: and countObjectsInBackgroundWithBlock that the object I will be operating in, in the block will be of NSArray of type Z.
My current solution: I thought of querying for X where exists Y (so I won't get empty objects of X. and just for every X, load all Y's and go through all arrays of Z.
I really don't think my solution is the best, hoping for someone that can point me at another solution to fit my situation.