summaryrefslogtreecommitdiff
path: root/src/mongo/shell/explain_query.js
diff options
context:
space:
mode:
authorDrew Paroski <drew.paroski@mongodb.com>2020-05-11 12:30:47 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-11 18:12:38 +0000
commitff441d6e3f30a5c6a779d416409a46d35d9c26b7 (patch)
treefc73e3b51140b965a1ae46e578a8b406fc973d00 /src/mongo/shell/explain_query.js
parente6dcc106ab333e7f2a96ea9f92d0c9fad6ff0da7 (diff)
downloadmongo-ff441d6e3f30a5c6a779d416409a46d35d9c26b7.tar.gz
SERVER-46686 Update explain() shell command to propagate "maxTimeMS" arg to top-level, take 2
Diffstat (limited to 'src/mongo/shell/explain_query.js')
-rw-r--r--src/mongo/shell/explain_query.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/shell/explain_query.js b/src/mongo/shell/explain_query.js
index c679683a421..b4935fd07d4 100644
--- a/src/mongo/shell/explain_query.js
+++ b/src/mongo/shell/explain_query.js
@@ -151,6 +151,11 @@ var DBExplainQuery = (function() {
var explainCmd = {explain: innerCmd};
explainCmd["verbosity"] = this._verbosity;
+ // If "maxTimeMS" is set on innerCmd, it needs to be propagated to the top-level
+ // of explainCmd so that it has the intended effect.
+ if (innerCmd.hasOwnProperty("maxTimeMS")) {
+ explainCmd.maxTimeMS = innerCmd.maxTimeMS;
+ }
var explainDb = this._query._db;