Create an user by first clicking on the terminal button were it says “MONGOSH” in the bottom left corner of the MongoDB compass program. Then write use <yourdbname> to get into your database. Then run:
db.createUser(
{
user: "mycollectionUser",
pwd: "examplepass123",
roles: [
{ role: "readWrite", db: "myDbName" }
]
}
)
To remove an user:
db.dropUser("mycollectionUser")