mKinveyClient.user().update(...) deletes other fields
C
Carlo
started a topic
about 7 years ago
After I call the method mKinveyClient.user().put(..) the I call mKinveyClient.user().update() happens that the other fields are erased. What happened for real? I expected the update method to just update the field I changed with put method. An example:
On dashboard John changed his name but he lost the surname. The field result to be blank.... why??
1 Comment
E
Edward
said
about 7 years ago
Currently we do not support partial updates, so every call to `update` will replace the existing user data with the new user data.
If you want to get around this and perform multiple updates to a user object, apply them to that `User u` that is returned from the call to onSuccess() for `update`. This object contains the latest state of the User.
Carlo
at first I call
String name = "John";
String surname = "Red"
mKinveyClient.user().put("name", name);
mKinveyClient.user().put("surname", surnme);
mKinveyClient.user().update(new KinveyUserCallback() {
@Override
public void onFailure(Throwable t) {
//some codes here
}
@Override
public void onSuccess(User u) {
//other codes here
}
});
It works fine!
But let Jonh changed his name to Carl then I call:
mKinveyClient.user().put("name", "Carl");
mKinveyClient.user().update(new KinveyUserCallback() {...//stuffs}
On dashboard John changed his name but he lost the surname. The field result to be blank.... why??