title: Meteor server reactivity
body: <p>I have an app with two collections</p>
  
  <pre><code>Books = new Meteor.Collection("books");
  Chapters = new Meteor.Collection("chapters");
  </code></pre>
  
  <p>where the documents look pretty much like this:</p>
  
  <pre><code>Book = {
    _id : BookId,
    users_who_can_view_this_book : [userId, userId]
  }
  
  Chapter = {
    book : BookId
  }
  </code></pre>
  
  <p>On the server I publish books and chapters like this:</p>
  
  <pre><code>Meteor.publish('books', function() {
    return Books.find({ users_who_can_view_this_book : { $in : [this.userId] } });
  });
  
  Meteor.publish('chapters', function() {
    var bookIds = Books.find({
      users_who_can_view_this_book : {$in : [this.userId] }
    }).map(function(book) {
      return book._id;
    });
    return chapters.find({book: {$in : bookIds}});
  });
  </code></pre>
  
  <p>On the client I just subscribe like this:</p>
  
  <pre><code>Meteor.subscribe('books');
  Meteor.subscribe('chapters')
  </code></pre>
  
  <p>So, if a user has access to a book I want the client to receive the book and its corresponding chapters. This works fine on initial load. </p>
  
  <p>Now, on the <em>server</em> I want to be able to add or remove users to/from the list on the book documents and when I do that, update the client with the new chapters. As of now, the client only get the update on the books, but the chapters referring to that book is not added/removed from the client. </p>
  
  <p>I understand that I need to change the way my chapters publication work. I have looked at the docs for cursor.observe and cursor.observeChange, but I really cannot grasp how to use them in this case. I have also studied <a href="https://stackoverflow.com/questions/10565654/how-does-the-messages-count-example-in-meteor-docs-work">this answer</a> but I dont get all of it. I'd be happy to explain what parts of that answer I have questions about but since it's a slightly different case I dont know if is relevant. Anyway, some guidance on this or a working example would be much appreciated!</p>