How do I query RealmObject that have RealmList that contains specified value

后端 未结 1 1966
暖寄归人
暖寄归人 2021-01-05 01:51

I have a RealmObject (let\'s say Owner) and it has RealmList. Cat has a property name. How do I q

相关标签:
1条回答
  • 2021-01-05 01:54

    . can be used when query child object/list fields, for your case try below:

    RealmResult<Owner> owners = realm.query(Owner.class)
        .contains("cats.name", "Garfield")
        .findAll();
    
    0 讨论(0)
提交回复
热议问题