diff options
author | terminaldweller <thabogre@gmail.com> | 2021-05-14 18:14:50 +0000 |
---|---|---|
committer | terminaldweller <thabogre@gmail.com> | 2021-05-14 18:14:50 +0000 |
commit | 6e528248414e330c9e25e81596ab47b8b8a5b701 (patch) | |
tree | e1aa41a7f3198eeac187e6177ec7d4a33db229d3 /.mongorc.js | |
download | scripts-6e528248414e330c9e25e81596ab47b8b8a5b701.tar.gz scripts-6e528248414e330c9e25e81596ab47b8b8a5b701.zip |
first commitmaster
Diffstat (limited to '.mongorc.js')
-rw-r--r-- | .mongorc.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/.mongorc.js b/.mongorc.js new file mode 100644 index 0000000..43424dd --- /dev/null +++ b/.mongorc.js @@ -0,0 +1,17 @@ +function prompt() { + + var username = ""; + var user = db.runCommand({ + connectionStatus: 1 + }).authInfo.authenticatedUsers[0]; + + if (!!user) { + username = user.user; + } else { + username = "anonymous"; + } + + var database = db.getName(); + + return `${username}:${database} >`; +} |