Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Fixed
-
5.0.13
-
None
-
None
-
Fully Compatible
-
ALL
-
135
Description
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