I have a Parse table that contains a "UserIDs" column, which is an array of Strings.
I want to query this table for any Row which contains a certain specified UserID in the userIDs column.
For example, let there be a row that contains "0zll0s7Faz", "x62ks620", ..., "x2jdo322" in this column, how can I get this row with a PFQuery.
So far, I have a PFQuery as follows:
PFQuery *query=[PFQuery queryWithClassName:@"Albums"];
NSString *ide = [PFUser currentUser].objectId;
[query whereKey:@"UserIDs" containsString:ide];
Alternatively, I have used
[query whereKey:@"UserIDs" equalTo:ide];
Is it possible to do this as simply as I want it, or what can you suggest?
whereKey:equalTo:
tests equality on a singular column, but it also tests membership on an array column, so...
PFQuery *query=[PFQuery queryWithClassName:@"Albums"];
NSString *ide = [PFUser currentUser].objectId;
[query whereKey:@"UserIDs" equalTo:ide];
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments