jim password: 12345 roles: readWrite,dbAdmin,userAdmin state: present - name. The read role grants the ability to read the data on non-system collections, such as system.namespaces, system.js and the system.indexes. The MongoDB dropUser command deletes the user from the database on which we are running the command. The command gives email protected the clusterAdmin and readAnyDatabase roles on the admin database and the readwrite role on the students database. This role should be created on the admin DB and the subsequent user should also be created on the admin DB.įor this role, instead of using the standard read role, we can inherit permissions from readAnyDatabase role. This module is part of the community.mongodb collection (version 1.4.2). An easy-to-follow step-by-step tutorial on adding MongoDB users and how to manage user roles in Eclipse using Java. The above example creates a user email protected on the student database. We can create a role on the admin database that’s similar to the one above, to grant Read, Create and Update privileges on all DB’s. All DB’s – Read, Insert & Update Permissions Also, note that the methods db.collection.findAndModify(), db.collection.mapReduce() and db.collection.aggregate() cannot be run in full as they require the remove privilege. A user that’s been granted permission by the above role will not have the “remove” privilege action. The above command would create a role with in database db1. CreateRole: "& amp amp amp amp amp amp amp amp amp amp lt role name& amp amp amp amp amp amp amp amp amp amp gt ",
0 Comments
Leave a Reply. |