Rotate a database credential.
Section: Users and roles
Change a user password
javascript
javascript
db.changeUserPassword("appuser", "new-strong-password")Explanation
Routine credential rotation is easier when you know the exact shell command.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Users and roles