summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam Midvidy <amidvidy@gmail.com>2015-08-24 23:22:48 -0400
committerAdam Midvidy <amidvidy@gmail.com>2015-08-24 23:38:33 -0400
commitefa95c72b047a3a92c13bba9562733b5d5e0f944 (patch)
treee22ad483df3065ed8002560584f58a5b3c93e6ad /src
parent8d4c5f743d1a72238a533cc4c69b75f3fbdbe637 (diff)
downloadmongo-efa95c72b047a3a92c13bba9562733b5d5e0f944.tar.gz
SERVER-20084 propogate overridden slaveOk setting though runReadCommand
Diffstat (limited to 'src')
-rw-r--r--src/mongo/shell/db.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/shell/db.js b/src/mongo/shell/db.js
index b20224c5869..181c1558fba 100644
--- a/src/mongo/shell/db.js
+++ b/src/mongo/shell/db.js
@@ -86,7 +86,7 @@ DB.prototype.commandHelp = function( name ){
// Like runCommand but applies readPreference if one has been set
// on the connection. Also sets slaveOk if a (non-primary) readPref has been set.
- DB.prototype.runReadCommand = function (obj, extra) {
+ DB.prototype.runReadCommand = function (obj, extra, queryOptions) {
"use strict";
// Support users who call this function with a string commandName, e.g.
@@ -96,7 +96,7 @@ DB.prototype.commandHelp = function( name ){
this._attachReadPreferenceToCommand(mergedObj,
this.getMongo().getReadPref());
- var options = 0;
+ var options = (typeof(queryOptions) !== "undefined") ? queryOptions : this.getQueryOptions();
var readPrefMode = this.getMongo().getReadPrefMode();
// Set slaveOk if readPrefMode has been explicitly set with a readPreference other than