【问题标题】:Can't subscribe to publication in Meteor无法订阅 Meteor 中的发布
【发布时间】:2014-07-02 10:18:07
【问题描述】:

我有一个包含集合、发布和订阅的应用,如下所示:

collections/Cities.coffee:

@Cities = new Meteor.SmartCollection('cities')

服务器/publications.coffee:

Meteor.publish "userCities", -> Cities.find { userId: @userId } 

client/subscriptions.coffee:

Meteor.subscribe "cities", 
    onReady: -> console.log 'subscription a success' 
    onError: (err) -> console.log 'subscription a failure', err  

订阅好像失败了,错误提到Internal server error [500]

Meteor服务器启动时也报错:

Exception from sub DrWAY95DFAEkjBHrY TypeError: Object function (name) { ...
} has no method '_compileSelector'

不知道哪里出了问题。我已经重置了服务器。

【问题讨论】:

标签: coffeescript meteor publish subscribe


【解决方案1】:

正如 Marco 在 cmets 中指出的那样,Meteor.smartCollection 已退役。切换到常规集合解决了这个问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-11-29
    • 2017-11-30
    • 2013-11-18
    • 2016-03-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多