Skip to content

Instantly share code, notes, and snippets.

@vseventer
Created June 7, 2012 13:36
Show Gist options
  • Select an option

  • Save vseventer/2888834 to your computer and use it in GitHub Desktop.

Select an option

Save vseventer/2888834 to your computer and use it in GitHub Desktop.
Updating an entity.
var entity = new Kinvey.Entity('my-collection');
entity.set('key', 'value');
entity.save({
success: function(entity) {
var value = entity.get('key');
// value == "value"
// Entity is now created, lets update another field.
entity.set('foo', 'bar');
entity.save({
success: function(entity) {
var foo = entity.get('foo');
// foo == "foo"
},
error: function(error) {
// Error.
}
});
},
error: function(error) {
// Error.
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment