diff options
Diffstat (limited to 'jstests/sharding/mongos_local_explain.js')
-rw-r--r-- | jstests/sharding/mongos_local_explain.js | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/jstests/sharding/mongos_local_explain.js b/jstests/sharding/mongos_local_explain.js index bf9ab379e53..d21ee745306 100644 --- a/jstests/sharding/mongos_local_explain.js +++ b/jstests/sharding/mongos_local_explain.js @@ -3,30 +3,30 @@ * confirms that the pipeline ran entirely on mongoS. */ (function() { - "use strict"; +"use strict"; - const st = new ShardingTest({name: "mongos_comment_test", mongos: 1, shards: 1}); - const mongosConn = st.s; +const st = new ShardingTest({name: "mongos_comment_test", mongos: 1, shards: 1}); +const mongosConn = st.s; - const stageSpec = { - "$listLocalSessions": {allUsers: false, users: [{user: "nobody", db: "nothing"}]} - }; +const stageSpec = { + "$listLocalSessions": {allUsers: false, users: [{user: "nobody", db: "nothing"}]} +}; - // Use the test stage to create a pipeline that runs exclusively on mongoS. - const mongosOnlyPipeline = [stageSpec, {$match: {dummyField: 1}}]; +// Use the test stage to create a pipeline that runs exclusively on mongoS. +const mongosOnlyPipeline = [stageSpec, {$match: {dummyField: 1}}]; - // We expect the explain output to reflect the stage's spec. - const expectedExplainStages = [stageSpec, {$match: {dummyField: {$eq: 1}}}]; +// We expect the explain output to reflect the stage's spec. +const expectedExplainStages = [stageSpec, {$match: {dummyField: {$eq: 1}}}]; - // Test that the mongoS-only pipeline is explainable. - const explainPlan = assert.commandWorked(mongosConn.getDB("admin").runCommand( - {aggregate: 1, pipeline: mongosOnlyPipeline, explain: true})); +// Test that the mongoS-only pipeline is explainable. +const explainPlan = assert.commandWorked(mongosConn.getDB("admin").runCommand( + {aggregate: 1, pipeline: mongosOnlyPipeline, explain: true})); - // We expect the stages to appear under the 'mongos' heading, for 'splitPipeline' to be - // null, and for the 'mongos.host' field to be the hostname:port of the mongoS itself. - assert.docEq(explainPlan.mongos.stages, expectedExplainStages); - assert.eq(explainPlan.mongos.host, mongosConn.name); - assert.isnull(explainPlan.splitPipeline); +// We expect the stages to appear under the 'mongos' heading, for 'splitPipeline' to be +// null, and for the 'mongos.host' field to be the hostname:port of the mongoS itself. +assert.docEq(explainPlan.mongos.stages, expectedExplainStages); +assert.eq(explainPlan.mongos.host, mongosConn.name); +assert.isnull(explainPlan.splitPipeline); - st.stop(); +st.stop(); })(); |