realm-js icon indicating copy to clipboard operation
realm-js copied to clipboard

Actually make primary key properties readonly

Open appden opened this issue 10 years ago • 1 comments

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.

appden avatar Feb 19 '16 23:02 appden

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.

cmelchior avatar Feb 23 '16 14:02 cmelchior