I have the following collections: 1. Users 2. Messages 3. Meta
I want to grab all the unique autor properties from the Messages and Meta collection. Then I want to subscribe to all the data about those users. So it's something like this:
var ids = [];
Messages.find().forEach(function(doc) {
ids.push(doc.author);
});
var allIds = ids.concat( Meta.findOne().authors );
Meteor.subscribe('contactInfo', _.uniq(allIds) );
The question is how to do all this at a router level so that all the subscriptions load before the page is rendered.