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]) #

ArgumentsTypeDescription
contentJSON ObjectProfile content
optionsJSON ObjectOptional parameters
callbackfunctionOptional callback handling the response

Options #

OptionTypeDescriptionDefault
queuablebooleanMake this request queuable or nottrue

Return Value #

Returns the Profile object to allow chaining.


Callback Response #

Returns the updated version of this object.

Usage #

var updateContent = {
  policies: [
    {roleId: 'myrole'},
  ]
};
// Using callbacks (NodeJS or Web Browser)
profile.update(updateContent, function(err, updatedProfile) {
  // the updatedProfile variable is the updated Profile object
})
// Using promises (NodeJS)
profile
  .updatePromise(updateContent)
  .then(updatedProfile => {
    // the updatedProfile variable is the updated Profile object
  });