diff --git a/jstests/sharding/resharding_oplog_sync_agg_resume_token.js b/jstests/sharding/resharding_oplog_sync_agg_resume_token.js
|
index 047a01abc8..3dbeb5d4d3 100644
|
--- a/jstests/sharding/resharding_oplog_sync_agg_resume_token.js
|
+++ b/jstests/sharding/resharding_oplog_sync_agg_resume_token.js
|
@@ -28,7 +28,9 @@ const localDb = rst.getPrimary().getDB("local");
|
jsTest.log("Run aggregation pipeline on oplog with $_requestReshardingResumeToken set");
|
const resEnabled = localDb.runCommand({
|
aggregate: "oplog.rs",
|
- pipeline: [{$match: {ts: {$gte: Timestamp(0, 0)}}}],
|
+ // The $addFields prevents the pipeline from being optimized away as a simple plan executor.
|
+ // This is necessary to force the pipeline to be evaluated using PlanExecutorPipeline.
|
+ pipeline: [{$match: {ts: {$gte: Timestamp(0, 0)}}}, {$addFields: {extra: {$literal: "hi"}}}],
|
$_requestReshardingResumeToken: true,
|
cursor: {batchSize: 1}
|
});
|