lateinit var outletResults: RealmResults<Outlet>
outletResults = Outlet.search(query)
val areas = outletResults.map { outlet -> outlet.area }.distinct()
for (area in areas) {
var outlets = outletResults.where().equalTo("area", area).findAll().sort("name")
....
....
}
我想基于outletResult获取每个区域的出口,我如何在不循环查询的情况下实现这一目标?