Creating User Accounts

Once you have created a user administrator, you can use that account to create other user accounts that can administer, read, and write to the databases. You add user accounts by using the addUser() method inside the MongoDB shell. The addUser() method accepts a document object that allows you to specify the user name, roles, and passwords that apply to that user. Table 12.2 lists the fields you can specify in the document object.

Image

Table 12.2 Fields used when creating users with the addUser() method

MongoDB provides a number of roles that you can assign to a user account. These roles enable you to implement intricate privileges ...

Get Node.js, MongoDB, and AngularJS Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.