-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Integration
-
Fully Compatible
-
v8.1
-
200
db.coll.aggregate([{$match: {b: 3}}, {$rankFusion: {input: {pipelines: {a: [{$sort: {_id: 1}}]}}}}])
That pipeline works even though it should reject it for $rankFusion not being the first stage of the pipeline.
We'd been relying on validation that $search/$vectorSearch/$geoNear must be the first stage of the pipeline. But if the first input pipeline is a custom-sorted pipeline without one of those stages, it won't have any validation to make sure $rankFusion was first. I believe "StageConstraints" on DocumentSourceRankFusion is unreachable code. We only call constraints() after desugaring