Roles in mongoDB

Connect with

Roles in mongoDBBuilt-in User Roles in mongoDB used for granding user for priviledges for authentication and authorization of database user in MongoDB.

1. Why Roles in MongoDB

Authorization with MongoDB, refer to Role bases accesses control. You can secure your database from any user which you don’t know want to access with permission. Authorization means access permission to a particular resource in DB.

First of all , you may think, what is Role? You can carefully observer following quote, you can understand the Role very well. Just for you simplicity , I highlighted important keyword with bold so that you can understand easily.

Roles are group of Previledge, actions over resources, that are granted to users over a given namespace ( database)

Let us talk about what Action is in above quote. All operations and commands user has to perform on mongoDB is called action , few of them are following.

  • insert
  • create
  • crateUser
  • addShard
  • addReplicaset
  • delete etc

Actions are performed on Resources. So, what is Resources now? The following are some example of resources in the context of Role bases access control in mongoDB.

  • Database/namespace
  • Collection
  • mongoDB Cluster

2. Reference

You can visit for more details.

Thanks for visiting this post for built-in roles in MongoDB. You can also visit MongoDB Tutorial Listing page for more articles on MongoDB document-oriented database.
Your comments are welcome to improve this post. Happy Learning 🙂

Connect with

Leave a Comment

Your email address will not be published. Required fields are marked *