summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorScott Hernandez <scotthernandez@gmail.com>2014-09-29 08:25:36 -0400
committerScott Hernandez <scotthernandez@gmail.com>2014-09-29 14:55:05 -0400
commite5de9146a0bcdd160661766cb168cb7530759444 (patch)
treef724e1779aabbc96d2f45056c853e67df760aeca /src/mongo
parent243f11cd82d7925c77df0b04fad58b18f70cf031 (diff)
downloadmongo-e5de9146a0bcdd160661766cb168cb7530759444.tar.gz
backport resync_with_write_load js test
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/shell/servers_misc.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mongo/shell/servers_misc.js b/src/mongo/shell/servers_misc.js
index 91db127998a..52a2f3a9381 100644
--- a/src/mongo/shell/servers_misc.js
+++ b/src/mongo/shell/servers_misc.js
@@ -290,6 +290,17 @@ function startParallelShell( jsCode, port, noConnect ){
var args = ["mongo"];
+ // Convert function into call-string
+ if (typeof(jsCode) == "function") {
+ var id = Math.floor(Math.random() * 100000);
+ jsCode = "var f" + id + " = " + jsCode.toString() + ";f" + id + "();";
+ }
+ else if(typeof(jsCode) == "string") {}
+ // do nothing
+ else {
+ throw Error("bad first argument to startParallelShell");
+ }
+
if (noConnect) {
args.push("--nodb");
} else if (typeof(db) == "object") {