What happens when I invoke update / insert on the client side assembly?

If I use Meteor.publish to push documents into a collection on the client side (for example, in the “message count” example), what happens when I insert / update / delete this collection on the client side (the so-called "message-count" "in the example in the documents)? Does anything reach the server, given that the" messages-count "collection does not exist at all on the server? How will we distribute document changes on the server in this case?

Note. I saw the star response of @debergalis where it explains in detail this example (here: https://stackoverflow.com/questions/57777/ ... ), and that makes sense. But this does not concern what happens when the client-side assembly ("counts" in its example) is called to insert / update documents.

UPDATE:

So, I tried it myself, and this is what happens: If I have a client collection called Counts (which is populated using Meteor.publish), then Counts.find works fine, but Counts.insert just doesn't work, saying it wasn’t found corresponding to Meteor.method, which is good.

But now I have a new problem. If my subscription collection on the client side has the same name as the published assembly on the server side (I have already removed the automatic publication package for meteors), then the client side of the insertion will be distributed to the server side and add this document to the server side of the mango. This is obviously unacceptable.

Thus, a client-side collection with the same name (that you are switching to the new Meteor.Collection) can successfully update the server-side collection with the same name, even if you disabled the autostart of the package. This is mistake?

+3
source share
2 answers

messages-count is not a collection, it is recorded with a single record containing one attribute.

, ; ...

0

Meteor.publish, (, " " ), , inser/update/remove ( "message-count" )?

"-" API "named". - "message-count". . // , .

API:

, - . API.

:

- , " ", ?

(. ), // .

?

(, , ), ? , , .

0

All Articles