svasva / meteor-publish-with-relations

Meteor.js SmartPackage to publish associated collections at once.
162 stars 30 forks source link

Help with Simple Case #24

Open ja-b opened 9 years ago

ja-b commented 9 years ago

I have two different collections (Servers and Events) with a one-to-one mapping between _id on the Servers collection and server_id on the Events collection. I simply want to join the fields of Events with the existing fields on Servers and publish this as Servers.

I am attempting to publish according to the following, with my client expecting results in the Servers collection. However, I don't seem to be getting any results and this doesn't trigger any errors in my console.

Am I missing something here?

Meteor.publish("servers", function () {
    Meteor.publishWithRelations({
        handle: this,
        collection: Servers,
        mappings: [{
            key: 'server_id',
            collection: Events
        }]
    });
});