publications.js 423 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * @file
  3. *
  4. *
  5. * User: marand
  6. * Date: 30/08/15
  7. * Time: 11:53
  8. */
  9. Meteor.publish('posts', function() {
  10. return Posts.find();
  11. });
  12. Meteor.publish('push_feed', function() {
  13. return PushFeed.find();
  14. });
  15. Meteor.publish('userData', function () {
  16. // If user is logged-in.
  17. if (this.userId) {
  18. return Meteor.users.find({
  19. _id: this.userId
  20. }, {
  21. fields: {
  22. 'emails': 1
  23. }
  24. });
  25. }
  26. });