realm-js
realm-js copied to clipboard
Actually make primary key properties readonly
I just tested it, and confirmed that I can indeed change a primary key value. However, the docs say this:
Once an object with a primary key is added to a Realm, the primary key cannot be changed.
I actually think we should leave that in the docs and change our behavior to match this. Supposedly, that is what the Cocoa binding does. Also, this change would allow us to move the very old #118 PR forward, since it was blocked on the issue of primary key props being writable.
Note that the Java binding allow for the primary key to be changed, but will throw an Exception if you try to change it to a value that already exists.