-
-
Save jhgaylor/ff096e12614c5d36499e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* file: server/data.js */ | |
Meteor.publish("helptexts",function() { | |
return HelpTexts.find(); | |
}); | |
Meteor.publish("publishTest", function () { | |
return HelpTexts.find({_id: "help-demo"}); | |
}); | |
/* file: client/base.js */ | |
if (!window.HelpTexts) { HelpTexts = new Meteor.Collection("helptexts"); } | |
if (!window.PublishTest) { PublishTest = new Meteor.Collection("publishTest"); } | |
helptexts_subscription = Meteor.subscribe("helptexts"); | |
publish_test_subscription = Meteor.subscribe("publishTest"); | |
/* in Chrome javascript console */ | |
HelpTexts.findOne({_id: "help-demo"}); // <- returns the document | |
PublishTest.findOne(); // <- returns undefined | |
PublishTest.find({_id: "help-demo"}).fetch(); // <- returns [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment