[SERVER-21200] $match w/ $text should not use DocumentSource::setSource() to enforce pipeline position Created: 29/Oct/15 Updated: 06/Dec/22 Resolved: 04/Dec/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework, Internal Code |
| Affects Version/s: | 3.2.0-rc1 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | James Wahlin | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | optimization | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query
|
| Participants: |
| Description |
|
A $match clause run with $text must be in the first position of an aggregation pipeline. Our current handling for this has DocumentSource::isValidInitialSource() returning false (which is not logically correct when $text is present) paired with a uassert in DocumentSource::setSource to enforce. We should change the way this is handled so that the DocumentSourceMatch interface reports correct information and so that pipeline position validation can be handled externally. |
| Comments |
| Comment by David Storch [ 04/Dec/17 ] |
|
This is now handled by Pipeline::ensureAllStagesAreInLegalPositions(): |