aboutsummaryrefslogblamecommitdiffstats
path: root/.mongorc.js
blob: 43424dd05412b0e4e770c2a044ad2df3da4a5188 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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} >`;
}