update msvc shell file
This commit is contained in:
@@ -1061,34 +1061,45 @@ const StringData _jscode_raw_utils =
|
||||
"shellPrintHelper( ___it___ );\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"shellHelper.show = function( what ){\n"
|
||||
"assert( typeof what == \"string\" );\n"
|
||||
"shellHelper.show = function (what) {\n"
|
||||
"assert(typeof what == \"string\");\n"
|
||||
"\n"
|
||||
"if( what == \"profile\" ) {\n"
|
||||
"if( db.system.profile.count() == 0 ) {\n"
|
||||
"if (what == \"profile\") {\n"
|
||||
"if (db.system.profile.count() == 0) {\n"
|
||||
"print(\"db.system.profile is empty\");\n"
|
||||
"print(\"Use db.setProfilingLevel(2) will enable profiling\");\n"
|
||||
"print(\"Use db.system.profile.find() to show raw profile entries\");\n"
|
||||
"}\n"
|
||||
"else {\n"
|
||||
"print();\n"
|
||||
"db.system.profile.find({ millis : { $gt : 0 } }).sort({$natural:-1}).limit(5).forEach( function(x){print(\"\"+x.millis+\"ms \" + String(x.ts).substring(0,24)); print(x.info); print(\"\\n\");} )\n"
|
||||
"db.system.profile.find({ millis: { $gt: 0} }).sort({ $natural: -1 }).limit(5).forEach(function (x) { print(\"\" + x.millis + \"ms \" + String(x.ts).substring(0, 24)); print(x.info); print(\"\\n\"); })\n"
|
||||
"}\n"
|
||||
"return \"\";\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"if ( what == \"users\" ){\n"
|
||||
"db.system.users.find().forEach( printjson );\n"
|
||||
"if (what == \"users\") {\n"
|
||||
"db.system.users.find().forEach(printjson);\n"
|
||||
"return \"\";\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"if ( what == \"collections\" || what == \"tables\" ) {\n"
|
||||
"db.getCollectionNames().forEach( function(x){print(x)} );\n"
|
||||
"if (what == \"collections\" || what == \"tables\") {\n"
|
||||
"db.getCollectionNames().forEach(function (x) { print(x) });\n"
|
||||
"return \"\";\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"if ( what == \"dbs\" ) {\n"
|
||||
"db.getMongo().getDBNames().sort().forEach( function(x){print(x)} );\n"
|
||||
"if (what == \"dbs\") {\n"
|
||||
"var dbs = db.getMongo().getDBs();\n"
|
||||
"var size = {};\n"
|
||||
"dbs.databases.forEach(function (x) { size[x.name] = x.sizeOnDisk; });\n"
|
||||
"var names = dbs.databases.map(function (z) { return z.name; }).sort();\n"
|
||||
"names.forEach(function (n) {\n"
|
||||
"if (size[n] > 1) {\n"
|
||||
"print(n + \"\\t\" + size[n] / 1024 / 1024 / 1024 + \"GB\");\n"
|
||||
"} else {\n"
|
||||
"print(n + \"\\t(empty)\");\n"
|
||||
"}\n"
|
||||
"});\n"
|
||||
"//db.getMongo().getDBNames().sort().forEach(function (x) { print(x) });\n"
|
||||
"return \"\";\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
|
||||
Reference in New Issue
Block a user