I have installed mongo db server and created an admin user :
use admin
db.createUser(
{
user: "superAdmin",
pwd: "admin123",
roles: [ "readWrite"]
})
Then I reconnect the shell using :
mongo --port 27017 -u "superAdmin" -p "admin123" --authenticationDatabase "admin"
However it's still allowing me to query database without even providing credentils.
Moreover, when I connect using credentials it's saying: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted.
What should I do to prevent anonymous connection and how can I get rid of this access control not enabled thing?