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

Add $product to calculate aggregate multiplication

    • Type: Icon: New Feature New Feature
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.6.0
    • Component/s: Aggregation Framework
    • Labels:
      None

      Add a '$product' aggregation function, which will work like the '$sum' operation, using multiplication (instead of addition) to calculate the total across records.

      Aggregation by multiplication is common operation used in financial application for calculating compounded values (e.g., returns), and in scientific applications (e.g., when result are used to measure growth).

      The new operator should be available in any place where $sum is allowed (aggregation, grouping, projection).

      The result of the operator should be the multiplication of all values RESULT = v1 * v2 * v3

      It should be possible, like the $sum, to provide expressions, and to provide inputs.

            Assignee:
            Unassigned Unassigned
            Reporter:
            yair.lenga@gmail.com Yair Lenga
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: