diff options
author | David Storch <david.storch@10gen.com> | 2015-03-19 15:27:54 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2015-03-23 17:45:59 -0400 |
commit | 2729de652a23d33aefc6c5ea89e6593c83b25c7f (patch) | |
tree | 007d9c94479d2bd3cb32c8d891c31888bdc90ec8 /src/mongo/shell/shell_utils.cpp | |
parent | a33b1a8688acdd296784e04a8bcb3933a2932247 (diff) | |
download | mongo-2729de652a23d33aefc6c5ea89e6593c83b25c7f.tar.gz |
SERVER-17286 add --readMode flag to shell
Passing '--readMode commands' to the shell will now cause it to run find using the find command,
combined with wire protocol OP_GET_MORE messages. The default readMode remains OP_QUERY style find.
Diffstat (limited to 'src/mongo/shell/shell_utils.cpp')
-rw-r--r-- | src/mongo/shell/shell_utils.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/shell/shell_utils.cpp b/src/mongo/shell/shell_utils.cpp index 77cf1103f1d..d1382a42f01 100644 --- a/src/mongo/shell/shell_utils.cpp +++ b/src/mongo/shell/shell_utils.cpp @@ -214,6 +214,10 @@ namespace mongo { return BSON("" << shellGlobalParams.writeMode); } + BSONObj readMode(const BSONObj&, void*) { + return BSON("" << shellGlobalParams.readMode); + } + BSONObj interpreterVersion(const BSONObj& a, void* data) { uassert( 16453, "interpreterVersion accepts no arguments", a.nFields() == 0 ); return BSON( "" << globalScriptEngine->getInterpreterVersionString() ); @@ -243,6 +247,7 @@ namespace mongo { // Need to define this method before JSFiles::utils is executed. scope.injectNative("_useWriteCommandsDefault", useWriteCommandsDefault); scope.injectNative("_writeMode", writeMode); + scope.injectNative("_readMode", readMode); scope.externalSetup(); mongo::shell_utils::installShellUtils( scope ); scope.execSetup(JSFiles::servers); |