SDK
SDK Jvm v1.x
2

UpdateSelf #

Updates the current user object in Kuzzle.

:::: tabs ::: tab Java

Arguments #

Copied to clipboard!
CompletableFuture<Map<String, Object>> updateSelf(
  final Map<String, Object> content)
  throws NotConnectedException, InternalException
Argument Type Description
content
Map<String, Object>
Hashmap representing the user content

Return #

Returns a Map with the following properties:

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

Usage #

Copied to clipboard!
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 #

Copied to clipboard!
fun updateSelf(
      content: Map<String, Any?>): CompletableFuture<Map<String, Any?>>
Argument Type Description
content
Map<String, Any?>
Hashmap representing the user content

Return #

Returns a Map with the following properties:

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

Usage #

Copied to clipboard!
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();

::: ::::