Changed behavior of $eq with $sum in aggregation

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Cannot Reproduce
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.6.0
    • Component/s: Aggregation Framework
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In releases prior to 2.6 the following statement would work

          "read": { "$sum": { "$eq": [ "$read", true ] } }
      

      Where essentially the "$eq" operation evaluated to true or false and was included in the $sum as either 1 or 0.

      This is always evaluating to 0 when applied to the $sum in 2.6 and now requires wrapping with a $cond operator to produce the desired result:

          "read": { "$sum": { "$cond": [ "$read", 1, 0 ] } }
      

      So I am wondering if this is by design or a bug. It does not seem to be documented as a changed behavior

              Assignee:
              Unassigned
              Reporter:
              Neil Lunn
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: