I am having a bit trouble setting up mongo-express with my local mongodb install. Basically, I created an admin user like this:
db.createUser(
{
user: "admin",
pwd: "abc123",
roles:["root"]
})
And in mongo-express's config.js I specified this account for the authentication. Running mongo-express -u "admin" -p "abc123" -d "admin" works, and opening the webview shows the admin database.
But that is the only DB it shows there, but I have more DBs within mongodb:
> show dbs
admin 0.000GB
local 0.000GB
test 0.112GB
I want the test DB to show up there as well, but I do not understand whats preventing mongo-express from displaying it. I do understand that authentication happens at DB level, but since the admin was created with root as role, mongo-express should be able to display all DBs, right?
Ok I found the problem:
Apparently one has to run 'mongo-express' with the '-a' flag when admin credentials are stored in the config.js and one wishes to let mongo-express access mongodb as admin.
This helped me: how to make mongo-express show all db?