Past the below code in the mongo shell
prompt = function() {
user = db.runCommand({connectionStatus:1}).authInfo.authenticatedUsers[0]
host = db.getMongo().toString().split(" ")[2]
curDB = db.getName()
if (user) {
uname = user.user
}
else {
uname = "local"
}
return uname + "@" + host + ":" + curDB + "> "
}
prompt = function() {
user = db.runCommand({connectionStatus:1}).authInfo.authenticatedUsers[0]
host = db.getMongo().toString().split(" ")[2]
curDB = db.getName()
if (user) {
uname = user.user
}
else {
uname = "local"
}
return uname + "@" + host + ":" + curDB + "> "
}
No comments:
Post a Comment