Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-70160

Do not push down $match that needs whole document before $internalUnpackBucket

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 5.0.13
    • 5.0.14
    • 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

      Attachments

        Activity

          People

            milena.ivanova@mongodb.com Milena Ivanova
            milena.ivanova@mongodb.com Milena Ivanova
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: