Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Query on relationship objects in realm

I have to classes stored using Realm.io (and therefore extending RLMObject) : class A and B, with class A having a property of type B. I would like to query all objects of class A where A.b.propertyX=something, but I can't get it working. Maybe is it not even possible ?

like image 604
PhilippeAuriach Avatar asked May 26 '26 17:05

PhilippeAuriach


1 Answers

Realm v0.81.0 now supports querying over a relationship. Here's how it works:

[A objectsWhere:@"b.propertyX == 'something'"]

or

[Person objectsWhere:@"ANY dogs.name == 'Alfonso'"]

like image 64
jpsim Avatar answered May 28 '26 06:05

jpsim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!