-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Integration
-
None
-
None
-
None
-
None
-
None
-
None
-
None
We have some scattered validation around. Now that SPM-4362 has made it required to go through LiteParsedPipeline, I think centralizing the parse-time, structural valdation on LiteParsedPipeline::validate() as much as possible would be a good simplification.
I'm thinking of code like this:
- https://github.com/10gen/mongo/blob/adffd77a1f36c6a42f59be6e59b46c7432edffa1/src/mongo/db/pipeline/pipeline.cpp#L93
- https://github.com/10gen/mongo/blob/adffd77a1f36c6a42f59be6e59b46c7432edffa1/src/mongo/db/extension/host/document_source_extension_optimizable.cpp#L209
- https://github.com/10gen/mongo/blob/adffd77a1f36c6a42f59be6e59b46c7432edffa1/src/mongo/db/pipeline/document_source_rank_fusion.cpp#L137
If we introduce a LiteParsedDocumentSource::validate() callback then we can do some of this stage-specific logic in this step also.