Added simple autocompletion for mongodb databases

This commit is contained in:
Fabio 'c0m3tx' Vitale 2017-03-07 15:17:41 +01:00
parent b908feebcf
commit 9d6312fb9e
2 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,5 @@
dbs = db.adminCommand( {listDatabases: 1} ).databases;
for(var i = 0; i < dbs.length; i++) {
print(dbs[i].name);
}

View File

@ -0,0 +1,6 @@
_mongodbs() {
mypath=$(dirname $0)
compadd $(mongo --quiet $mypath/load_databases.js)
}
compdef _mongodbs mongo