CocoaPods trunk is moving to be read-only. Read more on the blog, there are 9 months to go.
| TestsTested | ✗ |
| LangLanguage | Obj-CObjective C |
| License | MIT |
| ReleasedLast Release | May 2015 |
Maintained by Adam Fish.
Need to query a RLMObject against a to-many relationship using multiple properties? This category brings the hidden gem in NSPredicate, SUBQUERY, to Realm. For example, given this Realm setup:
Person : RLMObject
@property NSString *Id;
@property RLMArray<Dog> *dogs;
Dog : RLMObject
@property BOOL hasFleas;
@property NSString *color;it is now possible to write a query for all the Person(s) that have at least one Dog with fleas and is colored brown. This makes use of SUBQUERY in the resulting Realm query:
RLMResults *ownersOfBrownDogsWithFleas = [Person objectsWithSubqueryPredicate:@"SUBQUERY(dogs, $dog, $dog.hasFleas = YES AND $dog.color == 'brown').@count > 0"];The format is similar to the standard NSPredicate SUBQUERY expression:
SUBQUERY(RLMArray keypath, variable, predicate)Person has primary key Id).@count collection operator is supported.SUBQUERY are supported, but nested SUBQUERY is not.