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

Allow rewrite to push computed meta projections past $unpackBucket

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.0-rc0
    • Component/s: Querying
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Query Optimization 2021-04-05, Query Optimization 2021-04-19

      Description

      If we have an $addFields on both meta and bucket data, it would be worth to be able to split the $addFields into two parts - one depending only on the metadata, and another containing rest of the fields. The first part can then be pushed down. For example (approximately):

      {$unpackBucket: {exclude: []}},
      {$addFields : {newmeta : "$meta.foo", bar: "$x"}}
      -->
      {$addFields: {newmeta : "$meta.foo"}}
      {$unpackBucket: {exclude: []}},
      {$addFields: {bar: "$x"}}
      with 'newmeta' field added to the specification of the bucket in $unpackBucket

        Attachments

          Activity

            People

            Assignee:
            milena.ivanova Milena Ivanova
            Reporter:
            jacob.evans Jacob Evans
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: