diff options
author | Drew Paroski <drew.paroski@mongodb.com> | 2020-05-11 12:25:37 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-05-11 16:37:51 +0000 |
commit | af62a3eeaf0b1101cb2f6e8e7595b70f2fe2f10f (patch) | |
tree | 2f2e10ab0491f8b63b0155a7274b96247791a3b0 /src | |
parent | 0eebd4bdf5e3b771c3623341f5bc6184261c2db2 (diff) | |
download | mongo-af62a3eeaf0b1101cb2f6e8e7595b70f2fe2f10f.tar.gz |
Revert "SERVER-46686 Update explain() shell command to propagate "maxTimeMS" arg to top-level"
This reverts commit d7d3a0d782ced557c26b9eb81ea97cc242762c8f.
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/shell/explain_query.js | 5 | ||||
-rw-r--r-- | src/mongo/shell/explainable.js | 21 |
2 files changed, 4 insertions, 22 deletions
diff --git a/src/mongo/shell/explain_query.js b/src/mongo/shell/explain_query.js index b4935fd07d4..c679683a421 100644 --- a/src/mongo/shell/explain_query.js +++ b/src/mongo/shell/explain_query.js @@ -151,11 +151,6 @@ 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; diff --git a/src/mongo/shell/explainable.js b/src/mongo/shell/explainable.js index c47c7fab7cd..08a900c5274 100644 --- a/src/mongo/shell/explainable.js +++ b/src/mongo/shell/explainable.js @@ -35,16 +35,6 @@ var Explainable = (function() { return explainResult; }; - var buildExplainCmd = function(innerCmd, verbosity) { - var explainCmd = {"explain": innerCmd, "verbosity": 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; - } - return explainCmd; - }; - function constructor(collection, verbosity) { // // Private vars. @@ -127,7 +117,7 @@ var Explainable = (function() { let aggCmd = Object.extend( {"aggregate": this._collection.getName(), "pipeline": pipeline}, extraOptsCopy); - let explainCmd = buildExplainCmd(aggCmd, this._verbosity); + let explainCmd = {"explain": aggCmd, "verbosity": this._verbosity}; let explainResult = this._collection.runReadCommand(explainCmd); return throwOrReturn(explainResult); } @@ -150,7 +140,7 @@ var Explainable = (function() { this.findAndModify = function(params) { var famCmd = Object.extend({"findAndModify": this._collection.getName()}, params); - var explainCmd = buildExplainCmd(famCmd, this._verbosity); + var explainCmd = {"explain": famCmd, "verbosity": this._verbosity}; var explainResult = this._collection.runReadCommand(explainCmd); return throwOrReturn(explainResult); }; @@ -165,11 +155,8 @@ var Explainable = (function() { if (options && options.hasOwnProperty("collation")) { distinctCmd.collation = options.collation; } - if (options && options.hasOwnProperty("maxTimeMS")) { - distinctCmd.maxTimeMS = options.maxTimeMS; - } - var explainCmd = buildExplainCmd(distinctCmd, this._verbosity); + var explainCmd = {explain: distinctCmd, verbosity: this._verbosity}; var explainResult = this._collection.runReadCommand(explainCmd); return throwOrReturn(explainResult); }; @@ -248,7 +235,7 @@ var Explainable = (function() { else Object.extend(mapReduceCmd, optionsObjOrOutString); - const explainCmd = buildExplainCmd(mapReduceCmd, this._verbosity); + const explainCmd = {"explain": mapReduceCmd, "verbosity": this._verbosity}; const explainResult = this._collection.runCommand(explainCmd); return throwOrReturn(explainResult); }; |