I want remove all message object from realm those are equal to userid
RealmQuery<Message> rowQuery = realm.where(Message.class).equalTo(Message.USER_ID, userId);
realm.beginTransaction();
//TODO : here I want to remove all messages where userId is equal to "9789273498708475"
realm.commitTransaction();
In 0.88.3 and below you can do:
From 0.89 (next release) this will be
deleteAllFromRealm()
instead.This must be done between the realm.beginTransaction(); and the realm.commitTransaction(); I also listed in the code example a few args().
this is how i Used it