diff --git a/db/compact.cpp b/db/compact.cpp index d51705b4955..c4e237f2bc5 100644 --- a/db/compact.cpp +++ b/db/compact.cpp @@ -101,7 +101,7 @@ namespace mongo { unsigned lenWHdr = sz + Record::HeaderSize; unsigned lenWPadding = lenWHdr; { - lenWPadding *= pf; + lenWPadding = static_cast(pf*lenWPadding); lenWPadding += pb; lenWPadding = lenWPadding & quantizeMask(lenWPadding); if( lenWPadding < lenWHdr || lenWPadding > BSONObjMaxUserSize / 2 ) { diff --git a/shell/mongo_vstudio.cpp b/shell/mongo_vstudio.cpp index 3c6227c24d1..0ad5dd7f342 100644 --- a/shell/mongo_vstudio.cpp +++ b/shell/mongo_vstudio.cpp @@ -2349,6 +2349,7 @@ const StringData _jscode_raw_db = "DB.prototype.help = function() {\n" "print(\"DB methods:\");\n" "print(\"\\tdb.addUser(username, password[, readOnly=false])\");\n" +"print(\"\\tdb.adminCommand(nameOrDocument) - switches to 'admin' db, and runs command [ just calls db.runCommand(...) ]\");\n" "print(\"\\tdb.auth(username, password)\");\n" "print(\"\\tdb.cloneDatabase(fromhost)\");\n" "print(\"\\tdb.commandHelp(name) returns the help for the command\");\n" @@ -3157,12 +3158,22 @@ const StringData _jscode_raw_query = "print(\"\\t.size() - total # of objects cursor would return, honors skip,limit\")\n" "print(\"\\t.explain([verbose])\")\n" "print(\"\\t.hint(...)\")\n" +"print(\"\\t.addOption(n) - adds op_query options -- see wire protocol\")\n" +"print(\"\\t._addSpecial(name, value) - http://www.mongodb.org/display/DOCS/Advanced%20Queries#AdvancedQueries-Metaqueryoperators\")\n" +"print(\"\\t.batchSize(n) - sets the number of docs to return per getMore\")\n" "print(\"\\t.showDiskLoc() - adds a $diskLoc field to each returned object\")\n" +"print(\"\\t.min(idxDoc)\")\n" +"print(\"\\t.max(idxDoc)\")\n" +"\n" "print(\"\\nCursor methods\");\n" +"print(\"\\t.toArray() - iterates through docs and returns an array of the results\")\n" "print(\"\\t.forEach( func )\")\n" "print(\"\\t.map( func )\")\n" "print(\"\\t.hasNext()\")\n" "print(\"\\t.next()\")\n" +"print(\"\\t.objsLeftInBatch() - returns count of docs left in current batch (when exhausted, a new getMore will be issued)\")\n" +"print(\"\\t.count(applySkipLimit) - runs command at server\")\n" +"print(\"\\t.itcount() - iterates through documents and counts them\")\n" "}\n" "\n" "DBQuery.prototype.clone = function(){\n" @@ -3368,6 +3379,12 @@ const StringData _jscode_raw_query = "DBQuery.prototype.arrayAccess = function( idx ){\n" "return this.toArray()[idx];\n" "}\n" +"DBQuery.prototype.comment = function (comment) {\n" +"var n = this.clone();\n" +"n._ensureSpecial();\n" +"n._addSpecial(\"$comment\", comment);\n" +"return this.next();\n" +"}\n" "\n" "DBQuery.prototype.explain = function (verbose) {\n" "/* verbose=true --> include allPlans, oldPlan fields */\n" @@ -3489,6 +3506,8 @@ const StringData _jscode_raw_collection = "print(\"DBCollection help\");\n" "print(\"\\tdb.\" + shortName + \".find().help() - show DBCursor help\");\n" "print(\"\\tdb.\" + shortName + \".count()\");\n" +"print(\"\\tdb.\" + shortName + \".copyTo(newColl) - duplicates collection by copying all documents to newColl; no indexes are copied.\");\n" +"print(\"\\tdb.\" + shortName + \".convertToCapped(maxBytes) - calls {convertToCapped:'\" + shortName + \"', size:maxBytes}} command\");\n" "print(\"\\tdb.\" + shortName + \".dataSize()\");\n" "print(\"\\tdb.\" + shortName + \".distinct( key ) - eg. db.\" + shortName + \".distinct( 'x' )\");\n" "print(\"\\tdb.\" + shortName + \".drop() drop the collection\");\n" @@ -3517,7 +3536,7 @@ const StringData _jscode_raw_collection = "print(\"\\tdb.\" + shortName + \".storageSize() - includes free space allocated to this collection\");\n" "print(\"\\tdb.\" + shortName + \".totalIndexSize() - size in bytes of all the indexes\");\n" "print(\"\\tdb.\" + shortName + \".totalSize() - storage allocated for all data and indexes\");\n" -"print(\"\\tdb.\" + shortName + \".update(query, object[, upsert_bool, multi_bool])\");\n" +"print(\"\\tdb.\" + shortName + \".update(query, object[, upsert_bool, multi_bool]) - instead of two flags, you can pass an object with fields: upsert, multi\");\n" "print(\"\\tdb.\" + shortName + \".validate( ) - SLOW\");;\n" "print(\"\\tdb.\" + shortName + \".getShardVersion() - only for use with sharding\");\n" "print(\"\\tdb.\" + shortName + \".getShardDistribution() - prints statistics about data distribution in the cluster\");\n"