You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you create your MongoDB® Database Instance, a default user with administrative privileges is automatically created.
11
+
12
+
You can create more users and grant them pre-set roles via the [Scaleway Managed MongoDB® API](https://www.scaleway.com/en/developers/api/managed-database-mongodb/).
13
+
14
+
<Messagetype="important">
15
+
All users you create initially have administrator roles, which can be modified after creation using the [Apply user roles](https://www.scaleway.com/en/developers/api/managed-database-mongodb/#path-users-apply-user-roles) API call. However, the default user's role cannot be changed.
16
+
</Message>
17
+
18
+
### How to create a user
19
+
20
+
1. Edit the POST request payload you will use to create your user. Replace the values of each parameter with your values of choice following the parameter descriptions below.
|`password`| Set a password for the database user.|
32
+
33
+
2. Run the following command to create a user. Make sure you include the payload you edited in the previous step. `{instance_id}` corresponds to the UUID of the Managed MongoDB®.
All users you create will have the `read_write`, `db_admin` and `sync` roles on all databases by default.
68
+
69
+
You can follow the steps below to update a user's role(s) to the one(s) of your choice.
70
+
71
+
### How to apply a role to a user
72
+
73
+
1. Edit the POST request payload you will use to update the user role. Replace the values of each parameter with your values of choice following the parameter descriptions below.
74
+
75
+
In this example, we define a single `read_write` role for the user. This role applies only in the `example-db` database.
76
+
77
+
<Messagetype="tip">
78
+
To grant the user this role in all databases, you can set `any_database` to true.
|`read`| Read privileges on all non-system collections and the `system.js` collection. Refer to the [official MongoDB® documentation](https://www.mongodb.com/docs/manual/reference/built-in-roles/#mongodb-authrole-read) for an extensive list of the privileges granted to this role. |
97
+
|`read_write`| Read and write privileges on all non-system collections and the `system.js` collection. Refer to the [official MongoDB® documentation](https://www.mongodb.com/docs/manual/reference/built-in-roles/#mongodb-authrole-readWrite) for an extensive list of the privileges granted to this role. |
98
+
|`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. Refer to the [official MongoDB® documentation](https://www.mongodb.com/docs/manual/reference/built-in-roles/#mongodb-authrole-dbAdmin) for an extensive list of the privileges granted to this role. |
99
+
|`sync`| Role that aggregates three MongoDB roles: |
100
+
||`clusterMonitor` - Read-only access to monitoring tools. Refer to the [official MongoDB® documentation](https://www.mongodb.com/docs/upcoming/reference/built-in-roles/#mongodb-authrole-clusterMonitor) for an extensive list of the privileges granted to this role. |
101
+
||`backup` - Grants the minimal privileges needed to back up data. Refer to the [official MongoDB® documentation](https://www.mongodb.com/docs/upcoming/reference/built-in-roles/#mongodb-authrole-backup) for an extensive list of the privileges granted to this role. |
102
+
||`restore` - Grants the privileges needed to restore data from backups. Refer to the [official MongoDB® documentation](https://www.mongodb.com/docs/upcoming/reference/built-in-roles/#mongodb-authrole-restore) for an extensive list of the privileges granted to this role. |
103
+
104
+
2. Run the following command to apply a new role to the user. Make sure you include the payload you edited in the previous step and that you replace the parameters in the call with your information. `{instance_id}` corresponds to the UUID of the Managed MongoDB®.
If the call was successful, you will get the payload with the new role(s) as a response.
124
+
125
+
<Messagetype="note">
126
+
Assigning roles upon user creation will be possible by the second half of 2025. Refer to the [Scaleway Changelog](/changelog/?product=mongodb) to keep up with the latest Managed MongoDB® updates.
@@ -18,133 +18,59 @@ Users can connect to a database and access its data.
18
18
- A valid [API key](/iam/how-to/create-api-keys/)
19
19
- A [MongoDB® Database Instance](/managed-mongodb-databases/quickstart)
20
20
21
-
## How to change the password of your user
21
+
## How to create a new user
22
+
23
+
1. Click **MongoDB® Databases** under **Databases** on the side menu. A list of your Database Instances displays.
24
+
2. Click the database name to access the Database Instance information page.
25
+
3. Go to the **Users** tab.
26
+
4. Click **Create user**. A pop-up appears.
27
+
5. Enter a username and password for the user.
28
+
6. Click **Create User** to confirm. Your user is created. The privilege configuration wizard displays.
29
+
7. Set the privileges of your new user. You can select one or both of the following:
30
+
31
+
-**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:
32
+
-**Ready-only** (`read`) - Read privileges on all non-system collections and the `system.js` collection.
33
+
-**Read and write** (`read_write`) - Read and write privileges on all non-system collections and the `system.js` collection.
34
+
-**Sync** (`sync`) - Role that aggregates three MongoDB roles: `clusterMonitor`, `backup` and `restore`. This role can only be granted as a global role
35
+
-**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.
36
+
-**Specific roles** - the privileges will only apply to the databases you define. All global roles except `sync` can also be defined as specific roles.
37
+
38
+
<Messagetype="important">
39
+
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.
40
+
</Message>
41
+
42
+
<Messagetype="tip">
43
+
Refer to the [official MongoDB® documentation](https://www.mongodb.com/docs/manual/reference/built-in-roles/) for an extensive list of the privileges granted to each role.
44
+
</Message>
45
+
46
+
If you set a **global role**, select one or more roles in the drop-down.
47
+
48
+
If you set **specific roles**, enter the database(s) to which you want to apply the role first, then click **Set privileges**.
49
+
Check the box corresponding to the role(s) you wish to apply to each database in the list.
50
+
51
+
8. Click **Confirm** after reviewing your configuration.
52
+
53
+
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.
54
+
55
+
## How to update user privileges
56
+
57
+
1. Click **MongoDB® Databases** under **Databases** on the side menu. A list of your Database Instances displays.
58
+
2. Click the database name to access the Database Instance information page.
59
+
3. Go to the **Users** tab.
60
+
4. Click <Iconname="more" />, then **Update privileges**. A pop-up appears.
61
+
5. Update the privileges according to your preferences, following the instructions described in step 7 of the [procedure above](#how-to-create-a-new-user).
62
+
6. Click **Update** after reviewing your configuration.
63
+
64
+
## How to change user passwords
22
65
23
66
1. Click **MongoDB® Databases** under **Databases** on the side menu. A list of your Database Instances displays.
24
67
2. Click the database name or <Iconname="more" /> > **More info** to access the Database Instance information page.
25
-
3. Go to the **Users** tab. Your default user displays.
26
-
4. Click **Change password** to do so. A pop-up appears.
68
+
3. Go to the **Users** tab.
69
+
4. Click <Iconname="more" />, then **Change password**. A pop-up appears.
27
70
5. Enter your new password and confirm.
28
71
29
-
## How to create multi-users via the API
30
-
31
-
When you create your MongoDB® Database Instance, the first user is created by default and has admin rights.
32
-
33
-
You can create more users and grant them pre-set roles via the [Scaleway Managed MongoDB® API](https://www.scaleway.com/en/developers/api/managed-database-mongodb/).
34
-
35
-
<Messagetype="important">
36
-
All users you create have at first administrator roles, which can be changed after creation with the [Apply user roles](https://www.scaleway.com/en/developers/api/managed-database-mongodb/#path-users-apply-user-roles) call. The default user's role cannot be changed.
37
-
</Message>
38
-
39
-
### How to create a user
40
-
41
-
1. Edit the POST request payload you will use to create your user. Replace the values of each parameter with your values of choice following the parameter descriptions below.
|`password`| Set a password for the database user.|
53
-
54
-
2. Run the following command to create a user. Make sure you include the payload you edited in the previous step. `{instance_id}` corresponds to the UUID of the Managed MongoDB®.
All users you create will have the `read_write`, `db_admin` and `sync` roles on all databases by default.
89
-
90
-
You can follow the steps below to update a user's role(s) to the one(s) of your choice.
91
-
92
-
### How to apply a role to a user
93
-
94
-
1. Edit the POST request payload you will use to update the user role. Replace the values of each parameter with your values of choice following the parameter descriptions below.
95
-
96
-
In this example, we define a single `read_write` role for the user. This role applies only in the `example-db` database.
97
-
98
-
<Messagetype="tip">
99
-
To grant the user this role in all databases, you can set `any_database` to true.
|`read`| Read privileges on all non-system collections and the `system.js` collection. Refer to the [official MongoDB® documentation](https://www.mongodb.com/docs/manual/reference/built-in-roles/#mongodb-authrole-read) for an extensive list of the privileges granted to this role. |
118
-
|`read_write`| Read and write privileges on all non-system collections and the `system.js` collection. Refer to the [official MongoDB® documentation](https://www.mongodb.com/docs/manual/reference/built-in-roles/#mongodb-authrole-readWrite) for an extensive list of the privileges granted to this role. |
119
-
|`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. Refer to the [official MongoDB® documentation](https://www.mongodb.com/docs/manual/reference/built-in-roles/#mongodb-authrole-dbAdmin) for an extensive list of the privileges granted to this role. |
120
-
|`sync`| Role that aggregates three MongoDB roles: |
121
-
||`clusterMonitor` - Read-only access to monitoring tools. Refer to the [official MongoDB® documentation](https://www.mongodb.com/docs/upcoming/reference/built-in-roles/#mongodb-authrole-clusterMonitor) for an extensive list of the privileges granted to this role. |
122
-
||`backup` - Grants the minimal privileges needed to back up data. Refer to the [official MongoDB® documentation](https://www.mongodb.com/docs/upcoming/reference/built-in-roles/#mongodb-authrole-backup) for an extensive list of the privileges granted to this role. |
123
-
||`restore` - Grants the privileges needed to restore data from backups. Refer to the [official MongoDB® documentation](https://www.mongodb.com/docs/upcoming/reference/built-in-roles/#mongodb-authrole-restore) for an extensive list of the privileges granted to this role. |
124
-
125
-
2. Run the following command to apply a new role to the user. Make sure you include the payload you edited in the previous step and that you replace the parameters in the call with your information. `{instance_id}` corresponds to the UUID of the Managed MongoDB®.
If the call was successful, you will get the payload with the new role(s) as a response.
145
-
146
-
<Messagetype="note">
147
-
Assigning roles upon user creation will be possible by the second half of 2025. Refer to the [Scaleway Changelog](/changelog/?product=mongodb) to keep up with the latest Managed MongoDB® updates.
0 commit comments