From 52fc08fb5dee411e710ed7a5f659c2d0d6ef85ee Mon Sep 17 00:00:00 2001 From: Dwight Date: Thu, 14 Oct 2010 13:32:40 -0400 Subject: [PATCH] update msvc shell file --- db/db_10.sln | 1 - shell/mongo_vstudio.cpp | 33 +++++++++++++++++++++----------- shell/msvc/mongo.vcxproj | 2 +- shell/msvc/mongo.vcxproj.filters | 6 +++--- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/db/db_10.sln b/db/db_10.sln index db584aeee19..bd01965ce4d 100644 --- a/db/db_10.sln +++ b/db/db_10.sln @@ -12,7 +12,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{2B262D59 ..\tools\restore.cpp = ..\tools\restore.cpp ..\tools\sniffer.cpp = ..\tools\sniffer.cpp ..\tools\stat.cpp = ..\tools\stat.cpp - ..\tools\tool.cpp = ..\tools\tool.cpp ..\tools\tool.h = ..\tools\tool.h EndProjectSection EndProject diff --git a/shell/mongo_vstudio.cpp b/shell/mongo_vstudio.cpp index bdf2b4c71ec..f53e6df76d3 100644 --- a/shell/mongo_vstudio.cpp +++ b/shell/mongo_vstudio.cpp @@ -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" diff --git a/shell/msvc/mongo.vcxproj b/shell/msvc/mongo.vcxproj index b158b9ecd48..d3ec19e3ac0 100644 --- a/shell/msvc/mongo.vcxproj +++ b/shell/msvc/mongo.vcxproj @@ -111,9 +111,9 @@ NotUsing NotUsing + - diff --git a/shell/msvc/mongo.vcxproj.filters b/shell/msvc/mongo.vcxproj.filters index 426a8b06332..a37d5012b51 100644 --- a/shell/msvc/mongo.vcxproj.filters +++ b/shell/msvc/mongo.vcxproj.filters @@ -192,9 +192,6 @@ shell - - shared source files - shared source files @@ -219,6 +216,9 @@ shared source files + + scripting +