In realm, how to query from a RealmList (Android)
12,712
Just use RealmList.where()
to create a query. You can find document here
For example:
RealmList<Mail> mails = person.getMails();
RealmResults<Mail> results = mails.where().equalTo("id", 1).findAllSortedAsync();
Author by
guness
I am a lifetime student due to my eagerness to learning. I took care my work just like a a good father take care of his children.
Updated on June 14, 2022Comments
-
guness almost 2 years
Check out following classes:
class Person{ int id; String name; RealmList<Mail> mails; ... } class Mail{ int id; String content; ... }
I have a
Person
object (ie:mPerson
) and I am accessing allMail
s of thePerson
object bymPerson.getMails()
. Till here everything is cool.
Here is the question: Is there way to query over the returned list such as
findAllSortedAsync()
?