summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/lookup_max_nested_pipeline.js
diff options
context:
space:
mode:
authorMilitsa Sotirova <militsa.sotirova@mongodb.com>2021-06-21 18:00:06 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-07-01 13:45:52 +0000
commit3f0bedf42873fdf53a0ee3c38d98847d8359c602 (patch)
tree2cdcdd2e1727221f050cea375bf37d2cc7585f3f /jstests/noPassthrough/lookup_max_nested_pipeline.js
parenta969d643218bd3df38ff57709949350fceab44d2 (diff)
downloadmongo-3f0bedf42873fdf53a0ee3c38d98847d8359c602.tar.gz
SERVER-52021: Create feature flag for support lookup and graphLookup into a sharded collection
Diffstat (limited to 'jstests/noPassthrough/lookup_max_nested_pipeline.js')
-rw-r--r--jstests/noPassthrough/lookup_max_nested_pipeline.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/jstests/noPassthrough/lookup_max_nested_pipeline.js b/jstests/noPassthrough/lookup_max_nested_pipeline.js
index 2c6899a31ab..d673c3ecdce 100644
--- a/jstests/noPassthrough/lookup_max_nested_pipeline.js
+++ b/jstests/noPassthrough/lookup_max_nested_pipeline.js
@@ -5,10 +5,9 @@
(function() {
"use strict";
-load("jstests/aggregation/extras/utils.js"); // For assertErrorCode.
-load("jstests/libs/collection_drop_recreate.js"); // For assertDropCollection.
-load("jstests/libs/discover_topology.js"); // For findNonConfigNodes.
-load("jstests/noPassthrough/libs/server_parameter_helpers.js"); // For setParameterOnAllHosts.
+load("jstests/aggregation/extras/utils.js"); // For assertErrorCode.
+load("jstests/libs/collection_drop_recreate.js"); // For assertDropCollection.
+load("jstests/libs/discover_topology.js"); // For findNonConfigNodes.
function generateNestedPipeline(foreignCollName, numLevels) {
let pipeline = [{"$lookup": {pipeline: [], from: foreignCollName, as: "same"}}];
@@ -70,11 +69,14 @@ const sharded = new ShardingTest({mongos: 1, shards: 2});
assert(sharded.adminCommand({enableSharding: "test"}));
assert(sharded.adminCommand({shardCollection: "test.lookup", key: {_id: 'hashed'}}));
-setParameterOnAllHosts(DiscoverTopology.findNonConfigNodes(sharded.getDB('test').getMongo()),
- "internalQueryAllowShardedLookup",
- true);
-runTest(sharded.getDB('test').lookup);
+const isShardedLookupEnabled =
+ sharded.s.adminCommand({getParameter: 1, featureFlagShardedLookup: 1})
+ .featureFlagShardedLookup.value;
+
+if (isShardedLookupEnabled) {
+ runTest(sharded.getDB('test').lookup);
+}
sharded.stop();
}());