Skip to main content
Version: 2.0.10

MongoDB Users

MongoDB Users page listing users with their roles and the Change Password and Delete buttons MongoDB Users page listing users with their roles and the Change Password and Delete buttons

This section lists all your MongoDB users and offers options to reset a user's password or delete a user.

Available options on the Users page are:

  • Create a new user
  • Assign a user to a database
  • Remove a user from a database
  • Reset a user's password
  • Delete a user

Create a New Database User

MongoDB users are essential for controlling who can access and interact with your databases, ensuring data security and controlled access to your application's information.

To create a new database user, click on the "Create User" button and fill in the username and password for the new user. New users are created with no roles - they can't access any database until they're assigned to one.

Create MongoDB User form with the username and password fields Create MongoDB User form with the username and password fields

Assign a User to a Database

For a MongoDB user to be allowed to connect to a database, they need to be granted a role on that database. To assign a user to a specific database, click on the "Assign User" button and select a username, database, and role.

Assign User to Database form with the user, database and role dropdowns Assign User to Database form with the user, database and role dropdowns

Remove a User from a Database

To remove a user's access from a database, click on the "Remove User" button, and in the new page, select a username, database, and role to revoke.

Remove User access from Database form with the user, database and role dropdowns Remove User access from Database form with the user, database and role dropdowns

Removing a user's role will immediately remove that permission on the database and is useful when you want to disable a user's access without actually deleting the user.

Change User Password

If you need to change a user's password, click on the "Change Password" button next to that user. A page will open where you can insert the new password, then click on the "Change Password" button to save it.

Change MongoDB user password form with the new password field Change MongoDB user password form with the new password field

Delete User

To delete a MongoDB user, click the Delete button next to the user in the Users table. The button turns into Confirm with a 5-second countdown; click it again before the countdown ends to delete the user.

Delete button of a MongoDB user turned into a Confirm button with a countdown after the first click Delete button of a MongoDB user turned into a Confirm button with a countdown after the first click

DANGER

⚠️ Deleting a MongoDB user will immediately remove that user and revoke all privileges to databases.

INFORMATION

Built-in MongoDB users (such as admin and root) are marked as System User and cannot be edited or deleted.