MongoDB Tutorial

MongoDB: db.revokeRolesFromRole() method () method


The db.revokeRolesFromRole() method is used to remove inherited roles from a role.


db.revokeRolesFromRole( "<rolename>", [ <roles> ], { <writeConcern> } )


Name Description Required /
rolename The name of the role from which to revoke roles. Required String
roles The inherited roles to remove. Required array
writeConcern The level of write concern to apply to this operation. The writeConcern document uses the same fields as the getLastError command. Optional document

In the roles field, you can specify both built-in roles and user-defined role.

To specify a role that exists in the same database where db.revokeRolesFromRole() runs, you can either specify the role with the name of the role:


Or you can specify the role with a document, as in:

{ role: "<role>", db: "<database>" }

To specify a role that exists in a different database, specify the role with a document.

Retrieve the restaurants data from here

Required Access

You must have the grantRole action on a database to grant a role on that database.

Previous: db.grantPrivilegesToRole() method
Next: db.grantRolesToRole() method

New Content: Composer: Dependency manager for PHP, R Programming

bedava porno