Skip to content

Instantly share code, notes, and snippets.

@WuXianglong
Created May 22, 2015 09:40
Show Gist options
  • Save WuXianglong/eba71347f2babe6bbce8 to your computer and use it in GitHub Desktop.
Save WuXianglong/eba71347f2babe6bbce8 to your computer and use it in GitHub Desktop.
个性化Mongo Client
print(" *** 努力实践mongodb,佛祖保佑!*** \n")
lis = new Array(
" _oo8oo_",
" o8888888o",
' 88" . "88',
' (| -_- |)',
' 0\\ = /0',
' ___/'==='\\___',
" .' \\\| |// '.",
" / \\\||| : |||// \\",
" / _||||| -:- |||||_ \\",
" | | \\\\ - /// | |",
" | \\_| ''\\---/'' |_/ |",
" \\ .-\\__ '-' __/-. /",
" ___'. .' /--.--\\ '. .'___",
" . '< '.___\\_<|>_/___.' >' .",
" | | : `- \\`.:`\\ _ /`:.`/ -` : | |",
" \\ \\ `-. \\_ __\\ /__ _/ .-` / /",
" =====`-.____`.___ \\_____/ ___.`____.-`=====",
" `=---=`"
);
for(x in lis){
print(lis[x]);
}
//过滤危险的辅助函数
var no = (function(){
print("Sorry,我不允许你做出删除这样危险的操作!");
});
// 禁止删除数据库
db.dropDatabase = DB.prototype.dropDatabase = no;
// 禁止删除集合
DBCollection.prototype.drop = no;
// 禁止删除索引
DBCollection.prototype.dropIndex = no;
// 更改提示
prompt = (function(){
return "😊 > "
})();
// 定制编辑器来编辑变量
EDITOR="/usr/bin/vim"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment