问题是服务器上的下一个代码:
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');
我很确定问题出在反应性数据源中,但仍然无法解决。
谢谢你的帮助!