Simplify vacuous $addFields stages

XMLWordPrintableJSON

    • Query Optimization
    • Minor Change
    • 200
    • 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:
            Vesko Karaganev
            Reporter:
            Mark Brinsmead
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: