SDK
SDK Javascript v5.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

update #

Performs a partial content update on this object.


update(content, [options], [callback]) #

Arguments Type Description
content JSON Object User content
options JSON Object Optional parameters
callback function Optional callback handling the response

Options #

Option Type Description Default
queuable boolean Make this request queuable or not true

Return Value #

Returns the User object to allow chaining.


Callback Response #

Returns the updated version of this object.

Usage #

Copied to clipboard!
var updateContent = {
  firstname: 'My Name Is',
  lastname: 'Jonas'
};
// Using callbacks (NodeJS or Web Browser)
user.update(updateContent, function(err, updatedUser) {
  // the updatedUser variable is the updated User object
});
// Using promises (NodeJS)
role
  .updatePromise(updateContent)
  .then(updatedUser => {
    // the updatedUser variable is the updated User object
  });