Is it possible to use nested SUBQUERY in NSPredicate?

As you can see, I have two one-to-many relationships. Is it possible to write such a nested SUBQUERY where I want to select all A, where any of Cs belonging to any of B belonging to A satisfies some condition?

enter image description here

+6
source share
1 answer

You can nest SUBQUERY in a predicate. But it seems that one SUBQUERY is enough here (if ds is a one-to-one relation from C to D ), for example

 [NSPredicate predicateWithFormat:@"SUBQUERY(bs, $x, ANY $x.cs.ds.name = %@) .@count > 0", name]; 
+10
source

All Articles