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

后端 未结 1 1982
暖寄归人
暖寄归人 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 owners = realm.query(Owner.class)
        .contains("cats.name", "Garfield")
        .findAll();
    

    0 讨论(0)
提交回复
热议问题