I think there might be 2 problems.
The first is that the published data ends up in the collection, Books
, on the client. That is the collection it is in on the server and that is the collection it will end up in on the client if the publish returns a cursor. Have a close look at the counts-by-room example in the docs and see how publish subscribe names match but that collection names need to be set with custom 'added(), remove(), changed() blocks to manage a collection of a different name on the client than the server.
The second problem is in how you are checking for the data on the client. Iron-router waits for the subscribe handle's ready() to return true. But that true just means that the server has sent all the data. From the docs on ready()- "True if the server has marked the subscription as ready. A reactive data source."
So the server has sent all the data but it might not yet be on the client. So you always need to check that the data you want is there and never assume that all the data has arrived just because the subscription is ready().
Try adding this to your client code:
Deps.autorun( function(){
// replace this.params.name with the name because it is no longer in scope
console.log( Books.findOne( {name: this.params.name} ));
});
And I think it will log the data you are looking for soon after the subscribe is ready.