allow using $reduce expression as accumulator in $group

XMLWordPrintableJSON

    • Query Optimization
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      If $group accepted $reduce as accumulator, it would allow expressing any and all accumulator operations that we don't have implemented.

      Proposed syntax:

      {$group:{_id:<expr>,
            g:{$reduce:{
                   input:<expr>,
                   initialValue:<expr>,
                   in:<expr> // using "$$value" and "$$this" same as the $reduce expression
            } }
      } }
      

            Assignee:
            [DO NOT USE] Backlog - Query Optimization
            Reporter:
            Asya Kamsky
            Votes:
            7 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated: