I would like to change the field name during the migration of the Realm domain. It seems that changing the field name is not supported, and only copy-and-remove is the only way to do it.
It is right? It consumes a lot of time.
The code below is my trial version to change the value field to summary copying and deleting.
RealmSchema schema = realm.getSchema(); schema.get("Invoice") .transform(new RealmObjectSchema.Function() { @Override public void apply(DynamicRealmObject obj) { obj.set("summary", obj.getString("value")); } }) .removeField("value");
source share