在我的用户集合中,我有一个名为synonym_ids
.
在客户端上显示此内容的最简单方法是什么?
我尝试从服务器发布以下内容,然后从客户端订阅。但是我收到此错误:
Internal exception while starting subscription 0ea473b6-8be4-43ec-8a56-988409a4b58a Error: Meteor.userId can only be invoked in method calls. Use this.userId in publish functions.
#server
Meteor.publish 'synonym_ids', () ->
if Meteor.userId()
return Meteor.users.findOne({_id: Meteor.userId()}).synonym_ids
#client
Meteor.autosubscribe () ->
Meteor.subscribe 'synonym_ids'