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

Add $product to calculate aggregate multiplication

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 3.6.0
    • Aggregation Framework
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: