Meteor.publish('posts', function(options) {
  check(options, {
    sort: Object,
    limit: Number
  });
  return Posts.find({}, options);
});

Meteor.publish('comments', function(postId) {
  check(postId, String);
  return Comments.find({ postId: postId });
});

Meteor.publish('notifications', function() {
  return Notifications.find({ userId: this.userId, read: false });
});

Meteor.publish('posts', function(sort, limit) {
  return Posts.find({}, { sort: sort, limit: limit });
});

Meteor.publish('comments', function(postId) {
  check(postId, String);
  return Comments.find({ postId: postId });
});

Meteor.publish('notifications', function() {
  return Notifications.find({ userId: this.userId, read: false });
});

Send sort order and limit separatly to avoid messing with the options
Send sort order and limit separatly to avoid messing with the options
