Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>At the moment there isn't an official way to send data to clients without writing it to a collection. Its a little tricker in meteor because the step to send data to multiple clients when there isn't a place to write to comes from when multiple meteor's are used together. I.e items sent from one meteor won't come to clients subscribed on the other.</p> <p>There is a temporary solution using Meteor Streams (<a href="http://meteorhacks.com/introducing-meteor-streams.html" rel="nofollow">http://meteorhacks.com/introducing-meteor-streams.html</a>) that can let you do what you want without writing to the database in the meanwhile.</p> <p>There is also a pretty extensive discussion about this on meteor-talk (<a href="https://groups.google.com/forum/#!topic/meteor-talk/Ze9U9lEozzE" rel="nofollow">https://groups.google.com/forum/#!topic/meteor-talk/Ze9U9lEozzE</a>) if you want to understand some of the technical details. This will actually become possible when the linker branch is merged into master, for a single server</p> <p>Here's a bit of way to have a 'virtual collection, its not perfect but it can do until Meteor has a more polished way of having it done.</p> <pre><code>Meteor.publish("virtual_collection", function() { this.added("virtual_coll", "some_id_of_doc", {key: "value"}); //When done this.ready() }); </code></pre> <p>Then subscribe to this on the client:</p> <pre><code>var Virt_Collection = new Meteor.Collection("virtual_coll"); Meteor.subscribe("virtual_collection"); </code></pre> <p>Then you could run this when the subscription is complete:</p> <pre><code>Virt_Collection.findOne(); =&gt; { _id: "some_id_of_doc", key: "value"} </code></pre> <p>This is a bit messy but you could also hook into it to update or remove collections. At least this way though you won't be using any plugins or packages.</p> <p>See : <a href="https://www.eventedmind.com/posts/meteor-how-to-publish-to-a-client-only-collection" rel="nofollow">https://www.eventedmind.com/posts/meteor-how-to-publish-to-a-client-only-collection</a> for more details and a video example.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload