Most of your tutorial is about how to select how much data to show by combining publication and subscription.
But I think a bit more in depth explanation should be in order explaining what exactly is going on and at what time.
Definition “Publications are functions on the server that define a stream of documents” implies that publications define which documents will be pushed to the client. At least this is how I understood it before I found out that clients can send parameters to publications while subscribing.
Since this client originated parameters also define which documents server will push to client I would say that more proper definition would be “Publications and subscriptions are functions that together define a stream of documents from server to client”.
Also term “stream of documents” is a bit vague? When I execute find() from the client does this triggers stream creation and at that point documents are sent from server to client? Or is this streaming going on continually as a way of caching MongoDB into MiniMongoDB?
Is publishing/subscribing about caching MongoDB or about reading data?
If it controls caching of MongoDB into MiniMongoDB this should be clearly stated and in this way this process is completely decoupled and unrelated from reading data from MiniMongoDB.
Looking at your diagram it looks like publishing/subscribing really is about caching MongoDB but this fact is not explicitly stated anywhere and it should be if it is true rather than relying that people might get on their own to that conclusion.
A border line examples might give more insight of how all this works.
If we have two subscriptions based on the same collection but using different filter what happens when client executed find(), which documents will it get?
If user in china inserts new document in MongoDB will that document get cached in MiniMongoDB on my client as soon as possible if publish/subscribe methods say it should even if at that moment I am not actively using the app?
If I understood correctly publish/subscribe should have no influence on inserting records to MiniMongoDB. So what happens when I insert a record I am not supposed to read as defined by publish/subscribe? Will this document find its way to MongoDB? Will it dissapear from MiniMongoDB?
This is super important topic for Meteor and I think it should have both super simple and super detailed explanation of what it is and how it works.
It is also interesting as hell.
Concerning your reference to the “the basic docs section on this topic”. It talks about “this.userId” but it doesn’t say that in order to use “this.userId” you have to install accounts package. Also there is no reference to what “this” is and what “this.userId” is.
In another post I asked a question what is this “this”? Where does it come from? How do I put my stuff in it?