V <-->> O <<--> P
I am trying to write the right predicate so that I can get all V
entities that have at least one or more O
entities that match a certain P
entity.
I've tried something like this:
NSPredicate * predicate = [NSPredicate predicateWithFormat:@"SUBQUERY(O, $b, ANY $bs.P == %@).@count > 0", P];
Not working. Obviously I am not thinking about this correctly so far. Any idea how I can get this query done properly?