Mariya James
Mariya James

Reputation: 985

publish composite with two ddp connected server in meteor

I want to use meteor publish composite two perform some join operations. I have two meteor application connected using ddp service. In which on first server i have given my code for publish composite. But how to call it from the server2.

My server1 code.

Meteor.publishComposite('board', function (userid) {
  console.log('here')
  return {
    find: function () {
      console.log(23456)
      return Meteor.users.find(userid);
    },
    children: [{
      find: function (user) {
      return Apartment.find(user.lineup);
    }]
  }
});

Where to call Meteor.subscribe('boards');?

How can i use it from the other application which i connected using ddp service. Thanks in advance.

Upvotes: 0

Views: 64

Answers (1)

user5084201
user5084201

Reputation:

Here is how:

var otherServer = DDP.connect(url);
otherServer.subscribe(); // subscribe to collections
otherServer.call(); // call meteor methods

full list of methods at: http://docs.meteor.com/#/full/ddp_connect

Upvotes: 1

Related Questions