SDK
SDK Dart Null Safety v3.x
2

updateUser #

Updates a user definition.


Future<KuzzleUser> updateUser(String id, Map<String, dynamic> body,
      {bool? waitForRefresh})

PropertyTypeDescription
id
String
User id
body
Map<String, dynamic>
User content
waitForRefresh
bool?

(null)
If set to true, Kuzzle will not respond until the updated user is indexed

body #

The body contains the list of profile ids to attach the user to and potential additional information.
Any other attribute can be added. Make sure to update the user mapping collection to match your custom attributes.

Example:

{
  'profileIds': [
    'default'
  ],
  'firstName': 'John',
  'lastName': 'Doe'
}

Return #

A User object containing information about the updated user.

Usage #

final result = await kuzzle.security.updateUser(
  'john.doe',
  {
    'profileIds': ['default'],
    'firstName': 'John',
    'lastName': 'Doe'
  }
);
/*
User {
  _id: 'john.doe',
  content:,
    { profileIds: [ 'default' ],
      fullName: 'John Doe',
      _kuzzle_info:
        { author: '-1',
          createdAt: 1561379086534,
          updatedAt: null,
          updater: null } } }
*/