Aggregation with meteorhacks:aggregate (why would I ever use $out)?
问题 This is a significant edit to this question, as I have changed the publication to a method and narrowed the scope of the question. I am using meteorhacks:aggregate to calculate and publish the average and median of company valuation data for a user-selected series of companies. The selections are saved in a Valuations collection for reference and the data for aggregation comes from the Companies collection. The code below works fine for one-time use (although it's not reactive). However,