0

I have the following code, where I attempt to retrieve users based on an array of user IDs:

NSArray *userIDsWhoLikedPhoto = [self.photo objectForKey:@"usersThatLikedPicture"];

PFQuery *userQuery = [PFUser query];
[userQuery whereKey:@"objectId" containsAllObjectsInArray:userIDsWhoLikedPhoto];
[queryQuery findObjectsInBackground];

However, I always get the error "Error: $all only works on array fields (Code: 102, Version: 1.2.18)". I am not quite sure what I am doing wrong, since I am passing in an array as the query term.

Thanks!

1 Answer 1

1

Figured this out:

[userQuery whereKey:@"objectId" containedIn:userIDsWhoLikedPhoto];
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.