Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am trying to query a PFObject that contains an array. I am looking to match a given NSString against any object within the PFObject's array of strings. According to http://blog.parse.com/2012/03/28/parse-supports-many-to-many-relations/, I can use whereKey:equalTo to look for matches within an array.

I have replaced the variable I would usually use with the string that I know to be in the array whose object I am querying. It is a character-for-character match. Yet the query returns no matches.

My code:

PFQuery *convosQuery = [PFQuery queryWithClassName:@"convo"];
PFObject *currentUserFacebookID = [NSString stringWithFormat:@"11808098"];
[convosQuery whereKey:@"nonUserFacebookIDs" equalTo:currentUserFacebookID];
[convosQuery findObjectsInBackgroundWithBlock:^(NSArray *convos, NSError *error) {
    for (PFObject *convo in convos) {
        NSLog(@"user/convo match found");

As I said, this returns no matches even though a PFObject of class "convo" contains for key "nonUserFacebookIDs" the value "[["11808098"]]".

What could be going on?

share|improve this question
add comment (requires an account with 50 reputation)

1 Answer

Does this object have any ACLs that might be restricting reads to a subset of users?

share|improve this answer
I have not messed with ACL. The ACL for the object that should be found reads: {"*":{"read":true},"3rkf7hoxrD":{"write":true,"read":true}} – mkc842 Jun 25 at 17:01
so as far as you can tell, this query for a string contained as an item in an array should work? – mkc842 Jun 25 at 18:50
Yes. If you contact us through parse.com/help, we can debug further. Make sure to submit the support request using the "Contact us privately" link and mention this post. – Hector Ramos Jun 26 at 4:10
add comment (requires an account with 50 reputation)

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.