publications.js 350 B

12345678910111213141516171819202122232425
  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('userData', function () {
  13. // If user is logged-in.
  14. if (this.userId) {
  15. return Meteor.users.find({
  16. _id: this.userId
  17. }, {
  18. fields: {
  19. 'emails': 1
  20. }
  21. });
  22. }
  23. });