Simplify vacuous $addFields stages

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      An empty `$addfields` stage, like:
      {{{$addFields: {} }}}
      has no effect on query results, but can prevent pushing stages like $sort and $limit, removing opportunities for other optimizations like non-blocking sorts.

      Rewriting the query to omit the empty `$addFields` should not alter the query, but may promote other optimizations.

            Assignee:
            Unassigned
            Reporter:
            Mark Brinsmead
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: