jstests/auth/builtin_roles_system_colls.js
// the users collection easier if you have a lot of users, etc.
the users collection easier if you have a lot of users, etc.
the users collection easier if you have a lot of users etc .
function testUserAdminAnyDatabaseSystemCollIndexing(adminDB) {
    adminDB.auth("root", "pwd");
    adminDB.createUser({ user: "king", pwd: "pwd", roles: ["userAdminAnyDatabase"] });
    adminDB.logout();
    adminDB.auth("king", "pwd");
    assert.commandWorked(adminDB.system.users.createIndex({ db: 1 }));
    assert.commandWorked(adminDB.system.roles.createIndex({ db: 1 }));
    assert.commandWorked(adminDB.system.users.dropIndex({ db: 1 }));
    assert.commandWorked(adminDB.system.roles.dropIndex({ db: 1 }));
    adminDB.logout();
}
function testUserAdminAnyDatabaseSystemCollIndexing ( adminDB ) { adminDB . auth ( "root" , "pwd" ) ; adminDB . createUser ( { user : "king" , pwd : "pwd" , roles : [ "userAdminAnyDatabase" ] } ) ; adminDB . logout ( ) ; adminDB . auth ( "king" , "pwd" ) ; assert . commandWorked ( adminDB . system . users . createIndex ( { db : 1 } ) ) ; assert . commandWorked ( adminDB . system . roles . createIndex ( { db : 1 } ) ) ; assert . commandWorked ( adminDB . system . users . dropIndex ( { db : 1 } ) ) ; assert . commandWorked ( adminDB . system . roles . dropIndex ( { db : 1 } ) ) ; adminDB . logout ( ) ; }
the users collection easier if you have a lot of users, etc.
the users collection easier if you have a lot of users etc .