summaryrefslogtreecommitdiff
path: root/src/mongo/shell/shell_utils.cpp
diff options
context:
space:
mode:
authorScott Hernandez <scotthernandez@gmail.com>2014-02-26 11:25:50 -0500
committerScott Hernandez <scotthernandez@gmail.com>2014-02-26 12:11:30 -0500
commita56653e1df978f68b887788b39d053e3f88bb0ea (patch)
tree4ba0d7d3114f6edc4a924a6ed40b42632bfe3736 /src/mongo/shell/shell_utils.cpp
parentf4c7d400c8f938374474a37cde54e36168e60b26 (diff)
downloadmongo-a56653e1df978f68b887788b39d053e3f88bb0ea.tar.gz
SERVER-12786: add shell writeMode option
Diffstat (limited to 'src/mongo/shell/shell_utils.cpp')
-rw-r--r--src/mongo/shell/shell_utils.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/shell/shell_utils.cpp b/src/mongo/shell/shell_utils.cpp
index b9b256c1c7e..ce3cf42a7a0 100644
--- a/src/mongo/shell/shell_utils.cpp
+++ b/src/mongo/shell/shell_utils.cpp
@@ -178,6 +178,10 @@ namespace mongo {
return BSON("" << shellGlobalParams.useWriteCommandsDefault);
}
+ BSONObj writeMode(const BSONObj&, void*) {
+ return BSON("" << shellGlobalParams.writeMode);
+ }
+
BSONObj interpreterVersion(const BSONObj& a, void* data) {
uassert( 16453, "interpreterVersion accepts no arguments", a.nFields() == 0 );
return BSON( "" << globalScriptEngine->getInterpreterVersionString() );
@@ -205,6 +209,7 @@ namespace mongo {
void initScope( Scope &scope ) {
// Need to define this method before JSFiles::utils is executed.
scope.injectNative("_useWriteCommandsDefault", useWriteCommandsDefault);
+ scope.injectNative("_writeMode", writeMode);
scope.externalSetup();
mongo::shell_utils::installShellUtils( scope );
scope.execSetup(JSFiles::servers);