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

allow using $reduce expression as accumulator in $group

    • Query Optimization

      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:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            7 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated: