I created a user with the role of userAdminAnyDatabase
db.createUser({user: "Username", pwd: "password", roles: [{role: "userAdminAnyDatabase", db: "admin"}]})
and also user with the role of userAdmin for a single db in the mongo shell.
db.createUser({user: "Username", pwd: "password", roles: [{role: "userAdmin", db: "myDB"}]})
But when I create or delete collections in myDB it's not asking me for the user name or password. What is the point of creating a user then?
I want the creation and deletion of databases and collections only when I give in the admin credentials.