Skip to content

Instantly share code, notes, and snippets.

@aaronthorp
Last active January 3, 2016 05:29
Show Gist options
  • Save aaronthorp/8416585 to your computer and use it in GitHub Desktop.
Save aaronthorp/8416585 to your computer and use it in GitHub Desktop.
Meteor.js - DDP Remote Connection for Meteor. @aaronthorp

Meteor.js - DDP Remote Connection for Meteor

Simple code fragment for connecting to remote collections via DDP

Support us via Gittip

if (Meteor.isServer) {
var remote = DDP.connect('http://server1.com/');
Items = new Meteor.Collection('items', remote);
}
if (Meteor.isClient) {
remote.subscribe('items', function() {
var items = Items.find();
console.log(items.count()); // get 1
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment