Skip to content

Instantly share code, notes, and snippets.

@AlexFrazer
Created April 3, 2015 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexFrazer/af847b0369b246ea6fc4 to your computer and use it in GitHub Desktop.
Save AlexFrazer/af847b0369b246ea6fc4 to your computer and use it in GitHub Desktop.
An example of publications and subscriptions
// browser
> Meteor.users.findOne()
{
_id: "1234"
}
// console
> Meteor.users.findOne()
{
_id: "1234",
profile: {
name: "Jack Sparrow"
},
services: [{
github: {
token: "56789",
username: "Jack Sparrow"
}
}]
Tracker.autorun(function() {
Meteor.subscribe('userdata');
})
Meteor.publish('userdata', function() {
return Meteor.users.find({}. {
fields: {
_id: true
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment