我有两个发布方法,如下所示,但是当我订阅客户端搜索页面中的某个发布方法时,它将被另一个用于索引页面的发布方法覆盖。流星发布覆盖另一个发布
服务器
Meteor.publish("task.index", function() {
TaskCollection.find()
}
Meteor.publish("task.index.search", function(state) {
TaskCollection.find({ state: state })
}
客户端 - 搜索页面
Meteor.subscribe("task.index.search", state)
// this will always be overwritten with "task.index" published collection
客户端 - 索引页
Meteor.subscribe("task.index")
有谁知道如何避免这种情况?