Welcome
Login
Sign up
Home
Solutions
Forums
How can we help you today?
Enter your search term here...
Search
Login
or
Signup
to submit a new ticket
Check ticket status
Start a new topic
Discussions
Kinvey Forums
Android
How to update just one value
a
agustinap24
started a topic
over 6 years ago
I would like to know how can I make an update on a database table for just one value.
Thanks for your help
1 Comment
E
Edward
said
over 6 years ago
Hey,
You would like to update one value within a specific entity?
to do this, you will first have to perform a get operation, then perform the modification, and then perform a save operation.
Assuming you know the entity ID, although you can modify the below get request to be any variation:
//First get the entity to update
client().appData("myCollection", MyEntity.class).getEntity("myID", new KinveyClientCallback() {
@Override
public void onSuccess(MyEntity result) {
//HERE is where you perform updates
result.fieldToUpdate = "myNewValue";
//and now call save with the updated entity
client().appData("myCollection", MyEntity.class).save(result, new KinveyClientCallback() {
@Override
public void onSuccess(MyEntity result) {
//DONE
}
@Override
public void onFailure(Throwable error) {}
});
}
@Override
public void onFailure(Throwable error) {}
});
Login
or
Signup
to post a comment
More topics in
Android
Can I add KinveyReferences and other custom Arrays to the User entity?
How can I use custom enums within my Entity?
Linking an image does not save with LinkedData
How can I get all records saved by the current user?
Why don't all users see the same data when querying?
Retrieving related file from datastore collection - continued
Problem implementing sign up / login
Can Android API be used for Java?
I'm not receiving push notifications
It is impossible to receive object according to the link
See all 259 topics
agustinap24
Thanks for your help