仅从选定的用户获取帖子

时间:2017-01-12 10:01:01

标签: javascript meteor

在https:https://github.com/DiscoverMeteor/Microscope中。你如何只从选定的用户那里获得帖子?

1 个答案:

答案 0 :(得分:0)

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

你必须把它放在你的帖子选择器中,就像你在通知中所做的那样