问题
How can I create an and operation with Realm?
Example I have an object with day and month and I want to check both those fields values.
Something like :
RealmResults<Event> toEdit = realm.where(Event.class)
.equalTo("day", day)
.and
.equalTo("month", month)
.findAll();
But as far as I can tell there is no and operator.
Thank you
回答1:
Multiple conditions are combined with And unless there's an .or() between them, so it's just:
RealmResults<Event> toEdit = realm.where(Event.class)
.equalTo("day", day)
.equalTo("month", month)
.findAll();
来源:https://stackoverflow.com/questions/32461425/check-two-fields-with-realm-database