There is currently no official way to send data to customers without writing to the collection. Its a little trick to a meteor, because the step of sending data to several clients, when there is no space for recording, comes from the fact that several meteors are used together. I. Items sent from one meteor will not arrive at customers signed to another.
There is a workaround using Meteor Streams ( http://meteorhacks.com/introducing-meteor-streams.html ) that allows you to do what you want without writing to the database in the meantime.
There is also a fairly extensive discussion about this on meteorites ( https://groups.google.com/forum/#!topic/meteor-talk/Ze9U9lEozzE ), if you want to understand some technical details, it will really become possible when the linker branch is merged into master, for one server
Here are some ways to have a "virtual collection that is not perfect, but it can do until Meteor has a more polished way of doing it."
Meteor.publish("virtual_collection", function() { this.added("virtual_coll", "some_id_of_doc", {key: "value"});
Then subscribe to this on the client:
var Virt_Collection = new Meteor.Collection("virtual_coll"); Meteor.subscribe("virtual_collection");
Then you can run this when the subscription is complete:
Virt_Collection.findOne(); => { _id: "some_id_of_doc", key: "value"}
It's a little dirty, but you can also connect to it to update or delete collections. At least this way, although you will not use any plugins or packages.
See: https://www.eventedmind.com/posts/meteor-how-to-publish-to-a-client-only-collection for more details and a video example.
Akshat
source share