I have a array in my Parse cloud for example ["Peter","Steve"] and i want to query this object, but only have one of these two strings (for example @"Peter"). Is there any opportunity to query that? Thanks, Beeke
1 Answer
Yes. The whereKey:equalTo: method, when applied to an array column checks for containment in the array, so...
[query whereKey:@"firstNameArray" equalTo:@"Peter"];
... will check if @"Peter" is in the object's firstNameArray column.
EDIT - to check whether the array contains any in a set of elements, you can use whereKey:containedIn: ...
[query whereKey:@"firstNameArray" containedIn:@[ @"Peter", @"Paul" ]];
1 Comment
Beeke Weerts
Thank you for your replay! But I have another problem: I want to check if this array ("firstNameArray") contains the first or the second string from another array. Can you help me?