How to Grant MongoDB Roles to Multiple Users

In MongoDB, users are defined for specific databases. Each user is then assigned a list of roles that in turn define the user’s privileges. Not surprisingly, MongoDB’s API therefore makes it easy to assign a user a list of roles via the grantRolesToUser method: db.grantRolesToUser( "<username>", [ <roles> ], { <writeConcern> } ) However, MongoDB’s [...]

How to List MongoDB Users by Role

In this tutorial, we will see how to easily find and list all users that have been granted a specific role in MongoDB using our GUI, Studio 3T. In MongoDB, users are defined for specific databases. Each user is then assigned a number of roles that in turn define the user’s privileges. While MongoDB’s API [...]

Setting Up MongoDB User Authentication

It goes without saying that you need to secure your MongoDB instances. Leaving aside complementary network-level security such as VPNs or SSH, MongoDB 3.0 itself provides robust built-in user authentication that governs and restricts what users can and cannot see and do inside your MongoDB instances. At the very least, you should run your MongoDB [...]