SDK
SDK Jvm v1.x
2

UpdateSelf #

Updates the current user object in Kuzzle.

:::: tabs ::: tab Java

Arguments #

CompletableFuture<Map<String, Object>> updateSelf(
  final Map<String, Object> content)
  throws NotConnectedException, InternalException
ArgumentTypeDescription
content
Map<String, Object>
Hashmap representing the user content

Return #

Returns a Map with the following properties:

PropertyTypeDescription
_id
String
User's kuid
_source
Map<String, Object>
Additional (and optional) user properties

Usage #

Map<String, Object> credentials = new HashMap<>();
credentials.put("username", "foo");
credentials.put("password", "bar");
kuzzle.getAuthController().login("local", credentials).get();
Map<String, Object> custom = new HashMap<>();
custom.put("age", 42);
Map<String, Object> result =
  kuzzle.getAuthController().updateSelf(custom).get();

::: ::: tab Kotlin

Arguments #

fun updateSelf(
      content: Map<String, Any?>): CompletableFuture<Map<String, Any?>>
ArgumentTypeDescription
content
Map<String, Any?>
Hashmap representing the user content

Return #

Returns a Map with the following properties:

PropertyTypeDescription
_id
String
User's kuid
_source
Map<String, Any?>
Additional (and optional) user properties

Usage #

kuzzle.authController.login("local", HashMap<String, Any?>().apply {
  put("username", "foo")
  put("password", "bar")
}).get()
val result: Map<String, Any?> =
  kuzzle.authController.updateSelf(HashMap<String, Any?>().apply {
    put("age", 42)
  }).get();

::: ::::