Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible in realm to change the primary key later..?

Tags:

android

realm

I set a temporary primary locally and save the object to realm, and later the server assigns a unique key for the object and then I want to update the primary key for the object.

So is it possible to reassign a primary key for the object? And what happens when we reassign a primary key to the object? Will it save the object with the old primary key?

like image 213
vishal gaware Avatar asked Jul 12 '16 12:07

vishal gaware


1 Answers

It is possible to change the value of a primary key up to Realm 1.2.0.

It is prohibited to change primary key value since Realm 2.0.x.

like image 141
EpicPandaForce Avatar answered Nov 06 '22 18:11

EpicPandaForce