aboutsummaryrefslogtreecommitdiffstats
path: root/.mongoshrc.js
blob: 493e9258bba5cbdda8516400ff734327dc70a9e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
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`;
    ;
  };
}