db.getSiblingDB("$external").runCommand({createUser:"C=US,ST=New York,L=New York City,O=MongoDB,OU=University2,CN=M310 Client", roles:[{role:"userAdminAnyDatabase ", db:"admin"}]})
{
"ok" : 0,
"errmsg" : "No role named userAdminAnyDatabase @admin",
"code" : 31
}
It accept other roles, like “root”, but I suppose that validation will fail then.