Partial update of realmobjects



I have JSON that I convert to RealmObject ro and use the Realm.GetInstance().Add(ro, update:true) to add the object to the database. However, the ream object ro may only have one or two properties with values whereas in the database there may already exist that object with more complete data. However, what happens is that the ro object overwrites the properties of the one in the database instead of only updating those properties that have a value. Is there a way to tell realm that it should only update properties with values?



No, that is not currently possible. What you could do is obtain a reference to the existing object (if there is such), then assign the new values.