pompopo / PRealm

Realm library for React Native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot delete objects without primary key

pompopo opened this issue · comments

PRealm.deleteObject() cannot delete objects when the class does not have a primary key.
This is because passing objects from Objective-C to javascript loses some internal informations of RLMObject

To fix this

Plan A

Forcing the class to have a primary key. When PRealm.defineSchema() is called without primary key, PRealm adds private primary key automatically (for example _primary_key)

Plan B

Realm refer _row field to delete objects. Is it possible to refer this field from PRealm?
https://github.com/realm/realm-cocoa/blob/master/Realm/RLMObjectStore.mm#L532