I've a column/field called last_message_time
of type Date
in my Table A.
Suppose querying Table A returns x
results.
How do i sort these results based on dates inside last_message_time
column.
Example, in SQLite we have ORDER BY date(dateColumn)
RealmResults<A> sorted = realm.where(A.class)
.findAllSorted("last_message_time", Sort.ASCENDING);
EDIT: since Realm 4.3.0, the following is preferred:
RealmResults<A> sorted = realm.where(A.class)
.sort("last_message_time", Sort.ASCENDING)
.findAll();