Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories MongoDB Shell
Created by Guest
Created on Dec 11, 2020

create custom role with list of collection

currently, when creating a role, we need to list one collection per db for custom role db.getSisterDB('admin').createRole({role : 'readWriteCollectionXY', privileges : [ {resource : {db : "database_A", collection : "***"}, actions : ["find", "insert", "update"]}, {resource : {db : "database_A", collection : "yyy"}, actions : ["find", "insert", "update"]} ], roles : [] }) having an option to list all the collections in one db with the same permission would be a nice thing to have. db.getSisterDB('admin').createRole({role : 'readWriteCollectionXY', privileges : [ {resource : {db : "database_A", collections : ["***", "yyy"] }, actions : ["find", "insert", "update"]} ], roles : [] })