【发布时间】:2016-04-28 07:17:52
【问题描述】:
问题是服务器上的下一个代码:
Meteor.publish(null , function() {
let events = [];
Groups.find({participants: this.userId}).forEach(function(item) {
events.push(item.latestEvent);
});
return Events.find({_id: {$in: events}});
});
无法在客户端 > Events.find().fetch() 上查看新文档
无需重新加载页面。
两个集合都在lib 文件夹中:
Groups = new Mongo.Collection('groups');
Events = new Mongo.Collection('events');
我很确定问题出在被动数据源中,但仍然无法解决。
感谢您的帮助!
【问题讨论】:
标签: javascript meteor publish-subscribe mongo-collection