Save Preloader image


Latest News

Building the brands stronger and take you to
the next level of business!

Secure Database with user roles in MongoDB

By Jimish Parekh

This blog is about assigning roles to your particular database in MongoDB. If you have not secured your MongoDB please go to this blog and follow instructions.


Login & create a database

Create a database by simply using “use” command:

use demo

Create User

Create a user and assign them roles along with their credentials by following commands:

      user: “dbuser”,
      pwd: “Pa$$Word”,
      roles: [ “readWrite”, “dbAdmin” ]

You can get more information about roles here.

Happy Coding!