aboutsummaryrefslogtreecommitdiffstats
path: root/.mongoshrc.js
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-05-05 15:17:33 +0000
committerterminaldweller <thabogre@gmail.com>2022-05-05 15:17:33 +0000
commitf723eec9bac125536b3b956d9eb26fea8fb60deb (patch)
tree2fb071ee2d70c071d84bf255c6ccfeee725cf6ec /.mongoshrc.js
parentmore updates for irssi (diff)
downloadscripts-f723eec9bac125536b3b956d9eb26fea8fb60deb.tar.gz
scripts-f723eec9bac125536b3b956d9eb26fea8fb60deb.zip
update
Diffstat (limited to '.mongoshrc.js')
-rw-r--r--.mongoshrc.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/.mongoshrc.js b/.mongoshrc.js
new file mode 100644
index 0000000..493e925
--- /dev/null
+++ b/.mongoshrc.js
@@ -0,0 +1,12 @@
+{
+ const hostnameSymbol = Symbol("hostname");
+ prompt = () => {
+ if (!db[hostnameSymbol]) db[hostnameSymbol] = db.serverStatus().host;
+ return `\x1b[38;5;22m${db.getName()}\x1b[38;5;24m@${
+ db[hostnameSymbol]
+ }\x1b[38;5;22m:Uptime:${db.serverStatus().uptime}:Documents:${
+ db.stats().objects
+ } >>>\x1b[0m`;
+ ;
+ };
+}