Reputation: 41
Is there any method to group based on attribute I tried using realmresult.beginGroup(); and endgroup how to perform the fuction
persons.beginGroup();
for (int i = 0; i < value.size(); i++) {
if (i > 0) {
persons.or();
}
persons.equalTo(key, value.get(i));
}
persons.endGroup();
Upvotes: 4
Views: 5539
Reputation: 20126
No, Realm doesn't support the equivalent of SQL GROUP yet. It is being tracked here: https://github.com/realm/realm-java/issues/2309
Right now you unfortunately have to do that manually.
Upvotes: 1