Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-1287

$sum operator accepts an expression or an array of expressions

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • builder-0.1
    • Affects Version/s: None
    • Component/s: Builder
    • None

      When used in other supported stages, $sum has one of two syntaxes:

      • $sum has one specified expression as its operand:
      { $sum: <expression> } 

       

      • $sum has a list of specified expressions as its operand:
        { $sum: [ <expression1>, <expression2> ... ]  } 

         

      Only the 2nd syntax is implemented, because we thought it functionally covered the first with a single expression array.

      But in the 1st syntax, the expression can resolve to an array.

      Example : https://www.mongodb.com/docs/manual/reference/operator/aggregation/addFields/#using-two--addfields-stages

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            jerome.tamarelle@mongodb.com Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: