0

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 1

1

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" ]];
Sign up to request clarification or add additional context in comments.

1 Comment

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?

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.