Report this

What is the reason for this report?

Unable to create MongoDB user from command line

Posted on October 21, 2021
Rajkishore J

By Rajkishore J

Cloud Support Engineer

Hi, I have created a MongoDB managed database when I am trying to create any user from the mongo shell it gets created and after a few seconds, it gets disappeared.

Is this a bug?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi,

We have some limitations on our managed MongoDB cluster. For your reference, You can follow the below document on MongoDB limitations :

https://docs.digitalocean.com/products/databases/mongodb/#mongodb-limits

​​​​​​You cannot add users or edit permissions using the mongo shell for MongoDB managed database. Users must be added to the cluster using the DigitalOcean Control Panel.

And new users will receive the permissions of the doadmin user by default. You can’t change these permissions at this time; Our team is aware of this limitation and working on a workaround.

Adding to this only time we send the password over the wire is during our create a response and during our reset password response; we don’t store or manage the users’ password.

https://docs.digitalocean.com/products/databases/mongodb/how-to/manage-users-and-databases/

As we continue to work on improving our products and services, we encourage you to share your thoughts, ideas, or feedback you have at https://ideas.digitalocean.com/

I hope this helps!

Regards, Rajkishore

This comment has been deleted

Hi there,

DigitalOcean now supports per-database MongoDB RBAC (role-based access control) through the API. This means you can limit MongoDB users to specific databases and assign roles like Admin, Read/Write, or Read-Only.

You can find more details in the announcement here: https://www.digitalocean.com/blog/rbac-and-predefined-roles-for-mongodb

And check the documentation for usage examples:

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.