我的目标是在路由器路径/ 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"
我无法在客户端获取数据,这是我的出版物无效!
答案 0 :(得分:0)
query
未定义:
users: Meteor.users.find query, options