Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add an administrator account to MongoDB instance
db.createUser(
{
user: "admin_username",
pwd: "admin_password",
roles:
[
{
role: "userAdminAnyDatabase",
db: "admin"
}
]
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment