Added simple autocompletion for mongodb databases
This commit is contained in:
parent
b908feebcf
commit
9d6312fb9e
5
plugins/mongo/load_databases.js
Normal file
5
plugins/mongo/load_databases.js
Normal file
@ -0,0 +1,5 @@
|
||||
dbs = db.adminCommand( {listDatabases: 1} ).databases;
|
||||
|
||||
for(var i = 0; i < dbs.length; i++) {
|
||||
print(dbs[i].name);
|
||||
}
|
6
plugins/mongo/mongo.plugin.zsh
Normal file
6
plugins/mongo/mongo.plugin.zsh
Normal file
@ -0,0 +1,6 @@
|
||||
_mongodbs() {
|
||||
mypath=$(dirname $0)
|
||||
compadd $(mongo --quiet $mypath/load_databases.js)
|
||||
}
|
||||
compdef _mongodbs mongo
|
||||
|
Loading…
Reference in New Issue
Block a user