Meteor.publish(‘users’,function(){
return {name:‘xxx’}
})
console.log(Meteor.subscribe(‘users’))
print data isn`t {name:‘xxx’}
how to use?
thanks.
Meteor.publish(‘users’,function(){
return {name:‘xxx’}
})
console.log(Meteor.subscribe(‘users’))
print data isn`t {name:‘xxx’}
how to use?
thanks.
You are using Meteor.publish
, which is used for MongoDB cursors, or the pub/sub API.
You can use a Meteor method to return data such as {name:‘xxx’}
.
If you need to use Meteor.publish
, especially for users, you should read the Meteor Guide: