publications.js 318 B

1234567891011121314151617
  1. Meteor.publish('posts', function() {
  2. return Posts.find();
  3. });
  4. Meteor.publish('comments', function(postId) {
  5. check(postId, String);
  6. return Comments.find({
  7. postId: postId
  8. });
  9. });
  10. Meteor.publish('notifications', function () {
  11. return Notifications.find({
  12. userId: this.userId,
  13. read: false
  14. });
  15. });