Mongodb 路由器中的流星订阅

Mongodb 路由器中的流星订阅,mongodb,meteor,iron-router,Mongodb,Meteor,Iron Router,我的目标是在路由器路径/home2上发布客户端3个用户的用户数据 代码如下: Meteor.publish "featured_talent", -> console.log 'talent publishing:' query = 'profile.picture': $exists: true $ne: null 'show_on_talent_view': true 'p

我的目标是在路由器路径/home2上发布客户端3个用户的用户数据

代码如下:

Meteor.publish "featured_talent", ->
    console.log 'talent publishing:'
    query = 
        'profile.picture':
            $exists: true
            $ne: null
        'show_on_talent_view': true
        'profile.roles.talent': true

    options = 
        limit: 3
        fields:
            profile: 1
        sort:
            createdAt: -1
    usr = Meteor.users.find query, options
    return usr
在服务器上的路由器中订阅

Router.map ->
    @route "home2",
        path: "/home2"
        waitOn: ->
            Meteor.subscribe "featured_talent"

我无法从客户端获取数据,这是因为我的出版物无法工作

未定义路由器中以下行上的查询:

users: Meteor.users.find query, options

显然,变量
query
服务器/路由器中不可用。coffee
。如果你想定义一个全局变量,不要使用
var
,或者在你的情况下,使用
@query=…
。所以在我的文章中,我使用了@query='profile.picture':$exists:true$ne:null'profile.is_test':$ne:true'profile.is_featured':true'profile.roles.talent':true还是同样的错误!我是新来的流星,所以如果你能详细阐述一点,这将是一个很大的帮助!谢谢你能提供一个存储库吗?好吧,这将是一个麻烦,回购是私人的。我正在一家公司实习,如果允许的话,我当然不知道。