Updating user roles

I created my local atlas cluster like this:

atlas deployments setup dev --bindIpAll --username admin --password admin --type local --port 27017 --mdbVersion 7.0 --force

The “admin” user is not allowed to drop collections. How can I adjust the admin users role so that he can drop collections? atlas dbusers update seems to require a project-id.

mongosh

db.grantRolesToUser('username', ['readWrite']);

I think

Thank you for the reply, however with what user am I supposed to grant these privileges?

Alright worked it out wit these steps:

atlas deployments setup dev --bindIpAll --username admin --password admin --type local --port 27017 --mdbVersion 7.0 --force

atlas deployments connect dev --username admin --password admin --type LOCAL

> use admin

> db.grantRolesToUser("admin", ["dbAdminAnyDatabase"]);
1 Like