Show current user, db access and role
Show current user
Situation: You want to grab your own info as the current user of MongoDB.
Run this command in Mongo Shell.
db.name_of_collection.runCommand({connectionStatus: 1})
# once you get user name, you can use this command
db.getUser("UserName")
For more content on data find me on Twitter.