Meteor.publish: publish collection which depends on other collection

Overview

As of this writing, reactive joins are an unsolved problem. For a complete overview see Reactive Joins In Meteor.

Recommendations

I strongly recommend against using observeChanges directly. It’s incredibly hard to get right, and easy to develop a memory leak. If you don’t believe me, watch this video on EventedMind. It will make your eyes bleed.

There are several package-based solutions to this problem. The meteor guide recommends publish-composite.

If you find the idea of using a package-based solution to be unacceptable, have a close look at the Joining On The Client section from Reactive Joins In Meteor. It’s clean but requires more waiting on the user’s part. Also see my post on template joins if you prefer to active your subscriptions at the template level.

Leave a Comment