1

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.

fardeem
  • 594
  • 5
  • 13
  • possible duplicate of [Meteor.publish: publish collection which depends on other collection](http://stackoverflow.com/questions/26398952/meteor-publish-publish-collection-which-depends-on-other-collection) – David Weldon Jan 08 '15 at 18:35

1 Answers1

0

If you wanna create relations between subscriptions this package will do the trick

Publish with relations

sdooo
  • 1,851
  • 13
  • 20