Publishing like this results in realtime distribution of data.
Meteor.publish("ItemsDirect", function () {
return Items.find({});
});
Publishing like this will loose realtime in LiveQuery serverside:
Meteor.publish("ItemsObserve", function () {
var handle = Items.find({}).observeChanges({
added: function (id, fields) {
self.added("MyCollectionName", id, cleanObject(fields));
}
// ...
});
});
It will take 1-10 s before the ‘added’-method is executed.
(Both Cursor.observe and Cursor.observeChanges has this behavior)
I’m doing like this because I need to set the collectionname (I need to hide my DB collection name for the client) and I need to clean my object before sending it to the client. BUT, I can not afford loosing realtime updates, it’s like running a MongoDB without oplog!
Can I remove this delay in Collection.observe?
Can I perhaps solve my problem in another way?
Tack you
Regards Magnus