The principle is that user can post opinions and only his friends can see them
So I will show you the data model and explanations to understand well
'User' table:
objectId, username, email etc... (all of default fields provided by Parse and many others but not necessary to quote for my question)
friends; Array - it contains all the users (objectid) that are friends with him -
updatedAt; (provided by default)
createdAt; (provided by default)
'Opinion' table:
objectId;
senderId; Pointer User table
content; String
updatedAt; (provided by default)
createdAt; (provided by default)
So I though about some tricks, querying all users before and do a restriction with with "wherekey:@"objectId" containedIn:"[[PFuser currentUser] objectForKey:@"friends]"
following by a query on the Opinion table restricting Opinions posts only to current User's friends... but without results...
Does anyone knows an easier way the to do this ?