i'm talking about i have a list from server and wanna to keep what there as its and what not coming from the server to delete them like i have a list of objects and wanna to delete the rest not in the list ?
db.executeTransaction(realm -> {
for (QualityControlDetailsResponse response : item.getResult()) {
QualityControlDetails controlDetails = db.where(QualityControlDetails.class)
.equalTo(QualityControlDetails.Fields.ID, response.getId()).findFirst();
if (controlDetails == null) {
controlDetails = db.createObject(QualityControlDetails.class, response.getId());
}
response.copyToRealm(controlDetails, db);
}
});
so i want to delete the other items not in my result how to do it ?
i know that i can delete all the table and adding to it whole items but i wanna to keep the items there as it is