Isa*_*ton 28
更新 :
您可以使用distinct()来获取对象类的不同条目.
// Returns the set of users that all have a different name
RealmResults<User> users = realm.where(User.class).distinct("name");
Run Code Online (Sandbox Code Playgroud)
注意:.distinct仅适用于已编制索引的字段(@Index或@PrimaryKey).它不适用于子对象属性.
您可以在官方文档中找到有关此方法的更多信息. https://realm.io/docs/java/latest/api/io/realm/Realm.html#distinct-java.lang.Class-java.lang.String-][1]
| 归档时间: |
|
| 查看次数: |
11395 次 |
| 最近记录: |