How to back subscribe data

Meteor.publish(‘users’,function(){
return {name:‘xxx’}
})

console.log(Meteor.subscribe(‘users’))

print data isn`t {name:‘xxx’}

how to use?

thanks

That’s not how it works. Please read this: https://guide.meteor.com/data-loading.html

1 Like

You’re supposed to return a cursor or an array of cursors. Please read the API spec: https://docs.meteor.com/api/pubsub.html#Meteor-publish

ok thanks:blush::blush::blush::blush::blush::blush::blush:

thanks
:smile::smile::smile::smile: