I’ve just released an update to
tunguska:reactive-aggregate. The API has changed, but should remain fully backwards compatible with any existing code using it. My thanks to all who helped test, especially @alawi for making some awesome suggestions , which have been included.
The key features are:
If you’re using
$lookupin your aggregation pipeline, this lets you trigger a re-aggregation when any, or all, of the collections taking part change. Each collection’s observer can be different, to ensure re-aggregations are optimal.
For very “busy” aggregations, which would impact performance if re-aggregation was too frequent, these let you scale back the reactivity, while still giving acceptable performance.
Rather like using a Meteor method, except the results are published to a Minimongo collection.
By using an observer on an unrelated collection, it’s possible to trigger a re-aggregation on-demand, or as a by-product of another process.