- Reference >
mongoShell Methods >- Database Methods >
- db.changeUserPassword()
db.changeUserPassword()¶
On this page
Definition¶
Required Access¶
You must have the changeAnyPassword action on a database to modify the password of any user on
that database.
To change your own password, you must have the
changeOwnPassword action
on your database. See
Change Your Password and Custom Data.
Example¶
The following operation changes the password of the user named
accountUser in the products database to SOh3TbYhx8ypJPxmt1oOfL: