Diyar GroupBy henüz desteklememektedir. Ayrıca beginGroup() öğesinin aslında parantez ile aynı olduğunu unutmayın. Ayda
değiştiğinde
// Between is [ monthStart, monthEnd ]
Date monthStart = new GregorianCalendar(2015, 5, 1).getTime();
Date monthEnd = new GregorianCalendar(2015, 6, 1).getTime() - 1;
accounts = realm.where(Account.class).between("date", monthStart, monthEnd).findAll();
veya böyle bir şey algılamak için:
Realm
// SQL pseudo code
SELECT * FROM Account WHERE (date = MONTH(date))
tek ay seçmek için böyle bir şey yapmak gerekir: Yani sorgu aslında olarak yorumlanır Hızlı yanıtınız için çok teşekkür ederim.
// pseudo code. You might want to use Calendar instead
accounts = realm.where(Account.class).findAllSorted("date")
Iterator<Account> it = accounts.iterator();
int previousMonth = it.next().getDate().getMonth();
while (it.hasNext) {
int month = it.next().getDate().getMonth();
if (month != previousMonth) {
// month changed
}
previousMonth = month;
}
İlk önce benim için çalışıyor. – schwertfisch