From 6e528248414e330c9e25e81596ab47b8b8a5b701 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Fri, 14 May 2021 22:44:50 +0430 Subject: first commit --- .mongorc.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .mongorc.js (limited to '.mongorc.js') 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} >`; +} -- cgit v1.2.3