Fix js munging

This commit is contained in:
Mathias Stearn
2010-07-16 15:42:28 -04:00
parent 15db784238
commit 5a2c3aa7ee
2 changed files with 15 additions and 3 deletions

View File

@@ -264,6 +264,7 @@ const char * jsconcatcode =
"print( \"warning: no DBRef\" );}\n"
"if ( typeof( BinData ) != \"undefined\" ){\n"
"BinData.prototype.tojson = function () {\n"
"//return \"BinData type: \" + this.type + \" len: \" + this.len;\n"
"return this.toString();}}\n"
"else {\n"
"print( \"warning: no BinData class\" );}\n"
@@ -522,6 +523,8 @@ const char * jsconcatcode =
"print( tojson( x ) );}\n"
"shellAutocomplete = function( prefix ){\n"
"var a = [];\n"
"//a.push( prefix + \"z\" )\n"
"//a.push( prefix + \"y\" )\n"
"__autocomplete__ = a;}\n"
"shellHelper = function( command , rest , shouldPrint ){\n"
"command = command.trim();\n"
@@ -653,7 +656,9 @@ const char * jsconcatcode =
"print(\"\\trs.add(hostportstr) add a new member to the set with default attributes\");\n"
"print(\"\\trs.conf() return configuration from local.system.replset\");\n"
"print();\n"
"print(\"\\tdb.isMaster() check who is primary\");}\n"
"print(\"\\tdb.isMaster() check who is primary\");\n"
"print();\n"
"print(\"\\tsee also http://<host>:28017/_replSet for additional diagnostic info\");}\n"
"rs.status = function () { return db._adminCommand(\"replSetGetStatus\"); }\n"
"rs.initiate = function (c) { return db._adminCommand({ replSetInitiate: c }); }\n"
"rs.add = function (hostport) {\n"
@@ -1373,6 +1378,7 @@ const char * jsconcatcode =
"DBQuery.prototype.toString = function(){\n"
"return \"DBQuery: \" + this._ns + \" -> \" + tojson( this.query );}\n"
"DBQuery.shellBatchSize = 20;\n"
"// or db[\"colName\"]\n"
"if ( ( typeof DBCollection ) == \"undefined\" ){\n"
"DBCollection = function( mongo , db , shortName , fullName ){\n"
"this._mongo = mongo;\n"
@@ -1679,6 +1685,7 @@ const char * jsconcatcode =
"function( spec ){\n"
"var coll = mydb.getCollection( shortName + \".$\" + spec.name );\n"
"var mysize = coll.storageSize();\n"
"//print( coll + \"\\t\" + mysize + \"\\t\" + tojson( coll.validate() ) );\n"
"total += coll.dataSize();}\n"
");\n"
"return total;}\n"