summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/dbshell.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/shell/dbshell.cpp b/shell/dbshell.cpp
index 02ff6a197dc..cec7bfdac54 100644
--- a/shell/dbshell.cpp
+++ b/shell/dbshell.cpp
@@ -344,9 +344,8 @@ int _main(int argc, char* argv[]) {
}
if ( !script.empty() ) {
- script = "function() { " + script + " }";
mongo::shellUtils::MongoProgramScope s;
- if ( scope->invoke( script.c_str(), mongo::BSONObj() ) )
+ if ( ! scope->exec( script , "(shell eval)" , true , true , false ) )
return -4;
}