I have two views on the same collection. They both calculate a sum but using different filters.
If I open the first view in the Compass then I see a correct sum. Then if I switch to the second view I see an invalid sum (from the first view).
Opening any other views (e. g. a collection) and switching back to the second view helps - it starts showing correct value. Switching to the first view will show values from the second.
Pipeline I am using for views:
[ { $match: { state: { $in: [1, 2] } } }, { $group: { _id: "$username", sum : { $sum: "$weight" } } } ]
- is related to
-
COMPASS-3524 Using a View
- Closed