updateSelf #
Updates the current user object in Kuzzle.
Signature #
kuzzleio::User updateSelf(const std::string& content);
kuzzleio::User updateSelf(const std::string& content, const kuzzleio::query_options& options);
Arguments #
Arguments | Type | Description |
---|---|---|
content | const std::string& | JSON string representing the user content |
options | kuzzleio::query_options* | Query options |
options #
Additional query options:
Option | Type (default) | Description |
---|---|---|
queuable | bool ( true ) | If true, queues the request during downtime, until connected to Kuzzle again |
Return #
A kuzzleio::User object.
Exceptions #
Throws a kuzzleio::KuzzleException
if there is an error. See how to handle error.
Usage #
try {
kuzzle->auth->login("local", R"({"username":"foo","password":"bar"})");
kuzzleio::User updatedUser = kuzzle->auth->updateSelf(R"({"age": 42})");
std::cout << updatedUser.content() << std::endl;
// {"age": 42}
} catch (kuzzleio::KuzzleException &e) {
std::cerr << e.what() << std::endl;
}
Edit this page on Github(opens new window)