This recipe will help if you got error like this:
Failed: error creating intents to dump: error creating intents for database admin: error counting admin.system.new_users: (Unauthorized) not authorized on admin to execute command { count: "system.new_users"
The one working workaround at this time is (if we using in mongodump user "admin"):
db.createRole({
role: 'mongodump_fix_role',
privileges: [ { resource : { "db" : "admin", "collection" : "system.new_users" }, actions: [ "find" ] }],
roles: []
})
db.grantRolesToUser("admin", [{ role: "mongodump_fix_role", db: "admin" }])
More info: https://www.mongodb.com/community/forums/t/dropping-admin-system-new-users-collection/219435