Skip to navigationSkip to main contentSkip to footerScaleway DocsAsk our AI
Ask our AI

How to manage a MongoDB® Database Instance user

Users can connect to a database and access its data.

Before you start

To complete the actions presented below, you must have:

How to create a new user

  1. Click MongoDB® Databases under Databases on the side menu. A list of your Database Instances displays.

  2. Click the database name to access the Database Instance information page.

  3. Go to the Users tab.

  4. Click Create user. A pop-up appears.

  5. Enter a username and password for the user.

  6. Click Create User to confirm. Your user is created. The privilege configuration wizard displays.

  7. Set the privileges of your new user. You can select one or both of the following:

    • Global roles - the privileges you set will apply to all your databases, existing and future. You can set one or more global roll at a time. The available global roles include:

      • Ready-only (read) - Read privileges on all non-system collections and the system.js collection.
      • Read and write (read_write) - Read and write privileges on all non-system collections and the system.js collection.
      • Sync (sync) - Role that aggregates three MongoDB roles: clusterMonitor, backup and restore. This role can only be granted as a global role
      • DB admin (db_admin) - Privileges to perform administrative tasks on the database, such as schema-related tasks, indexing, and gathering statistics. This role does not grant privileges for user and role management.
    • Specific roles - the privileges will only apply to the databases you define. All global roles except sync can also be defined as specific roles.

      Important

      You can manually enter a database that does not yet appear in the list and set privileges for it. This might be helpful as it can take up to 15 minutes before a recently created database appears in the list. You can also set privileges for databases before you create them. Keep in mind that the name you define in this step must be identical in spelling to that of the actual database.

      Tip

      Refer to the official MongoDB® documentation for an extensive list of the privileges granted to each role.

    If you set a global role, select one or more roles in the drop-down.

    If you set specific roles, enter the database(s) to which you want to apply the role first, then click Set privileges. Check the box corresponding to the role(s) you wish to apply to each database in the list.

  8. Click Confirm after reviewing your configuration.

The list of your users is updated. You can see an overview of the global and speficic roles next to the name of each user.

How to update user privileges

  1. Click MongoDB® Databases under Databases on the side menu. A list of your Database Instances displays.
  2. Click the database name to access the Database Instance information page.
  3. Go to the Users tab.
  4. Click more icon, then Update privileges. A pop-up appears.
  5. Update the privileges according to your preferences, following the instructions described in step 7 of the procedure above.
  6. Click Update after reviewing your configuration.

How to change user passwords

  1. Click MongoDB® Databases under Databases on the side menu. A list of your Database Instances displays.
  2. Click the database name or more icon > More info to access the Database Instance information page.
  3. Go to the Users tab.
  4. Click more icon, then Change password. A pop-up appears.
  5. Enter your new password and confirm.
Still need help?

Create a support ticket
No Results