We can\'t seem to find any conclusive document on what permissions (user roles) are required to run mongodump on a specific db.
Say I have a db named
This minimal set of privileges seems to work fine for me (note that the built-in 'backup' role exists only in the 'admin' database'). The first privilege is needed to get rid of the [myDb.system.indexes: not authorized on myDb to execute command { count: "system.indexes", query: {} }] error:
db.createRole({
role: "myDumpRole",
privileges: [
{ resource: { db: "myDb", collection: "system.indexes" }, actions: [ "find"] },
{ resource: { db: "myDb", collection: "" }, actions: [ "find", "listCollections", "listIndexes", "indexStats"] }
]
});