how do I check whether certain value is exist or not in my realm database based on this code below?
realm.where(User.class).equalTo("cardId", cardId).findFirst()
Thanks in advance.
You can perform null check.
User user = realm.where(User.class).equalTo("cardId", cardId).findFirst();
if (user != null) {
// Exists
} else {
// Not exist
}