How to delete Realm objects which are removed from server API while using `createorupdate`?

Viewed 332

Let's say I have 5 objects from api.

I store them using realm.add(item, update: true) which will create or update 5 objects.

Next time, one item is removed from server side.

So when I call api afterward, total number of realms objects should be 4. Not 5.

Using realm.add(item, update: true) will not remove the un-included items from api. It stores only add or update.

What's the best way to handle that?

1 Answers
Related