MongoDB 8 · Backup and administration

Create a user

Create a user with read and write access to one database. Use a real password.

db.createUser({ user: "appUser", pwd: "change-me", roles: [{ role: "readWrite", db: "mydb" }] })

Official MongoDB 8 documentation

More backup and administration commands

All backup and administration commands · MongoDB 8 cheatsheet

Was this page helpful?