-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 5.0.13
-
Component/s: None
-
None
-
Fully Compatible
-
ALL
-
135
The aggregation with a single $match stage over timeseries
[{"$match" : {"$expr" : {"$getField" : "measurement1"}}}]
is incorrectly pushed before the internalUnpackBucket stage and evaluated to an empty document set.
This happens in DocumentSource::PushMatchBefore() function where the analysis misses the fact that the $match stage needs the entire document. https://github.com/mongodb/mongo/blob/v5.0/src/mongo/db/pipeline/document_source.cpp#L199