sec.userSetName( user-name as String, new-user-name as String, password as String ) as null
Changes the name of the user from $user-name to $new-user-name.
http://marklogic.com/xdmp/privileges/user-set-name
if
the currrent user is not $user-name.
If a user with name equal to $user-name is not found, an error is returned.
If $new-user-name is not unique, an error is returned.
This function must be executed against the security database.
declareUpdate(); const sec = require('/MarkLogic/security.xqy'); sec.userSetName( "William", "Bill", "temp") // Changes the username from "Wiiliam" to "Bill" and resets the password to "temp".
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.