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.

updateSelf #


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

Performs a partial update on the current user.

ArgumentsTypeDescription
contentJSON ObjectA plain javascript object representing the user
optionsstring(Optional) Optional arguments
callbackfunction(Optional) Callback handling the response

Options #

FilterTypeDescriptionDefault
queuablebooleanMake this request queuable or nottrue

Return value #

Returns the Kuzzle SDK object to allow chaining.


Callback Response #

Returns the updated user object.

Usage #

var newContent = {
  firstname: 'My Name Is',
  lastname: 'Jonas'
};
// Using callbacks (NodeJS or Web Browser)
kuzzle
  .updateSelf(newContent, function (err, updatedUser) {
  });
// Using promises (NodeJS)
kuzzle
  .updateSelfPromise(newContent)
  .then(updatedUser => {
  });