Updates a user’s password. Run the method in the database where the user is defined, i.e. the database you
Parameter Type Description
string Specifies an existing username with access privileges for this database.
string Specifies the corresponding password.
Optional. Specifies the authentication mechanism used. Defaults to either:
SCRAM-SHA-1on new 3.0 installations and on 3.0 databases that have been upgraded from 2.6 with authSchemaUpgrade; or
Changed in version 3.0: In previous version, defaulted to
For available mechanisms, see authentication mechanisms.
boolean Optional. Determines whether the server receives digested or undigested password. Set to false to specify undigested password. For use with SASL/LDAP authentication since the server must forward an undigested password to
To modify the password of another user on a database, you must have the
on that database.
The following operation changes the password of the user named
accountUser in the
products database to
use products db.changeUserPassword("accountUser", "SOh3TbYhx8ypJPxmt1oOfL")