0
I am trying to delete an item from a list using Realm, but all the methods I have tried so far have been failed.
The last one I tried for a few tips, it should work, but still no success.
View the code on github: https://github.com/andrelinos/react-native-realmdb/blob/master/src/pages/Main/index.js
I managed to erase the entire base using the code below:
realm.write(() => {
realm.delete(realm.objects('Repository'));
});
But deleting only one item, still unsuccessful. The code below should work, but simply returns error.
realm.delete(realm.objectForPrimaryKey('Repository', repository.id));
});
Error returned:
Possible Unhandled Promise Rejection (id: 17):
Error: Argument to 'delete' must be a Realm object or a collection of Realm objects.
delete@[native code]
Thanks in advance for your attention