0
我有一个meteor.js应用程序,我试图生产。我有一个集合UserEarnings,其中存储了每个用户已获得的“积分”记录。现在,我在发布的服务器上的所有记录:为什么当我在服务器上进行过滤时,Meteor.js发布不会返回任何结果?
Meteor.publish('userEarnings',() => UserEarnings.find());
和过滤记录下来,只在相关的多个客户端上的特定用户:
const composer = (props, onData) => {
const subscription = Meteor.subscribe('userEarnings');
if (subscription.ready()) {
const userEarnings = UserEarnings.find({owner: Meteor.user()._id}).fetch();
onData(null, { userEarnings });
}
};
export default composeWithTracker(composer, Loading)(AuthenticatedNavigation);
这是工作得很好,但最好我会被过滤在服务器上:
Meteor.publish('userEarnings',() => UserEarnings.find({ owner: this.userId }));
不幸的是,这样做产生了未返回任何结果当我打电话UserEarnings.find()获取()在客户端上。有谁知道这可能是为什么?请注意,我仅在订阅用户时订阅来自客户端的'userEarnings'。
我不确定是否有任何其他信息是相关的,但请让我知道,如果你认为有。我跑流星1.4
非常感谢!我正试图弄清楚这件事。 – Swiss