-
Type: Bug
-
Resolution: Cannot Reproduce
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.6.0
-
Component/s: Aggregation Framework
-
Labels:None
-
ALL
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