OPTIONS

db.changeUserPassword()

Definition

db.changeUserPassword(username, password)

Updates a user’s password.

Parameter Type Description
username string Specifies an existing username with access privileges for this database.
password string Specifies the corresponding password.

Example

The following operation changes the reporting user’s password to SOh3TbYhx8ypJPxmt1oOfL:

db.changeUserPassword("reporting", "SOh3TbYhx8ypJPxmt1oOfL")