Suppose the following situation:
Suppose: Person 1 has dogs: NY-white-Joe Person 2 has dogs: NY-brown-Mary, SF-white-Fluffy, LA-brown-Fluffy Person 3 has dogs: NY-brown-Fluffy, LA- white-pepito
Question: How can I request all people who have a brown dog called Fluffy?
What I tried using implicit AND:
RealmQuery<User> userQuery = realm.where(User.class).equalTo("dogs.color", "brown").equalTo("dogs.name", "Fluffy");
Then I read the documentation, and two equalTo () conditions are evaluated separately, which means I will have:
All users who have a brown dog AND a dog called Fluffy. (Thus, the results are P2, P3).
How do I write this query to apply conditions to the same dog?
source share