diff options
author | David Storch <david.storch@10gen.com> | 2015-07-09 17:30:02 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2015-07-10 13:01:57 -0400 |
commit | 035b91eb3d88478efcfbf504de9555921b6b1165 (patch) | |
tree | d0c35f25f7ce62cf07c68a691f5346a2c07491b1 /src/mongo/shell/mongo.js | |
parent | a508e4bd895b47047531f09828138ba8f2cffde1 (diff) | |
download | mongo-035b91eb3d88478efcfbf504de9555921b6b1165.tar.gz |
SERVER-17286 extend shell to use getMore command if --readMode is commands
Diffstat (limited to 'src/mongo/shell/mongo.js')
-rw-r--r-- | src/mongo/shell/mongo.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mongo/shell/mongo.js b/src/mongo/shell/mongo.js index 41f5b1fe978..29100a14db3 100644 --- a/src/mongo/shell/mongo.js +++ b/src/mongo/shell/mongo.js @@ -287,14 +287,19 @@ Mongo.prototype.writeMode = function() { return this._writeMode; }; -// -// Whether to use find command versus OP_QUERY style find. -// - -Mongo.prototype.useFindCommand = function() { +/** + * Returns true if the shell is configured to use find/getMore commands rather than the C++ client. + * + * Currently, the C++ client will always use OP_QUERY find and OP_GET_MORE. + */ +Mongo.prototype.useReadCommands = function() { return (this.readMode() === "commands"); } +/** + * Get the readMode string (either "commands" for find/getMore commands or "compatibility" for + * OP_QUERY find and OP_GET_MORE). + */ Mongo.prototype.readMode = function() { if ("_readMode" in this) { // We already have determined our read mode. Just return it. |