Create PFQuery for PFRelation with zero objects

75 Views Asked by At

I want to create a PFQuery for a PFRelation to find objects where the specified relation has zero objects in it. Here's what I've tried:

PFQuery *categoryQuery = [CatalogCategory query];
[categoryQuery whereKeyDoesNotExist:@"subcategories"];

But I get an error saying I can't use this operator on a PFRelation key. How else could I achieve what I'm looking for?

1

There are 1 best solutions below

1
On

Have you tried [categoryQuery whereKey:@"subcategories" equalTo:nil]?

It may be that the whereKeyDoesNotExist: method is unavailable for objects of the PFRelation type.