(the Articles collection is available to both server and client)
When I use publications of this kind, I get update failed: Method not found errors in the browser console, which are printed by debug.js. Hence I guess my publication using _publishCursor is somewhat related to this error message.
Please give me a hint how to fix these update errors. Actually I do not even perform updates on those publications.
Why not just return cursor?
But update failed: Method not found looks like when you remove insecure package and try to update the Collection from the client. It tryes to call `/<collection_name>/update``` method on the server
surely he is doing because he wants to send documents to a different collection, and yes this error should be by updates being made outside the publication
How can I see which part of my code is trying to call the update method? Actually I am just reading my collections, not updating. At least not intentionally…
The error message is exactly the same, but there aren’t any update calls in my code, nor reasons for updates, nor reasons for a missing update method.
You are working above ArticleMetadata - so the update/insert/remove etc need to be defined above ArticleMetadata. But as there is no such server-side collection, it cannot be defined => not used.
You can insert/update/remove in Articles, but than use Articles.update instead of ArticleMetadata.update.
Side-effect: Nothing retrieved from the server any more …
Too much magic for me …
What is the preferred way to share a single server-side collection among different client-side collections? Because that is what I am trying to achieve actually …
My use case:
My articles (Mongo documents) live on the server. The client shows article metadata (titles/URLs/… in my case) in the menu of articles, but not their huge bodies. AND the client can edit individual articles, body included.
Currently, I have one client-side collection for the menu (which excludes the body field) and one client-side collection for editing the article.
I am using low level publish API for some data retrieval, transformation/aggregating between few collection and than pushing to client.
But for our usecase non-reactive was enough.
Still in Meteor.publish documentation that room count example is how to do some basic reactive custom publish.
Well I am already using that low-level kind of publish in order to provide JSON versions of my articles. But I do not see how it could solve that error message problem.
In fact I am pretty astonished that no one else faced my use case/problem in the past, since it seems nothing special to me, more like an everyday use case.
I regard the un-documented _publishCursor as a handy shortcut for observeChanges if I do not need custom added, changed and removed handlers. After all replacing _publishCursor by observeChanges gives me the same result, plus a bunch of additional lines of code…