1
新文檔的問題是在服務器上的下一個代碼:Meteor.publish服務器上不顯示在客戶端
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');
我敢肯定的問題是數據的反應源,但仍無法修復它。
謝謝你的幫助!