From 0017eacbe91d776499c19007df858e208bf52b12 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Wed, 18 Sep 2013 13:58:13 -0700 Subject: [PATCH] use docfetcher --- packages/mongo-livedata/mongo_driver.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/mongo-livedata/mongo_driver.js b/packages/mongo-livedata/mongo_driver.js index 19f604b8d0..3e9113d8a9 100644 --- a/packages/mongo-livedata/mongo_driver.js +++ b/packages/mongo-livedata/mongo_driver.js @@ -124,6 +124,7 @@ MongoConnection = function (url, connectionOptions) { }).run(); }); + self._docFetcher = new DocFetcher(self); self._oplogHandle = null; // XXX we should NOT be reading directly from the env here (this should be an // argument to MongoConnection eg) but I want to wait for the AppConfig API to @@ -375,10 +376,10 @@ MongoConnection.prototype._observeChangesWithOplog = function ( if (isModifier) { // XXX problem is, the result of this findOne is delivered at a random // time, not necessarily synced with other stuff that may be coming down - // the oplog. also, we should coalesce multiple pings of the same - // document ("ID queue"). also, we shouldn't read fields that aren't + // the oplog. also, we shouldn't read fields that aren't // necessary to evaluate selector or to publish. - newDoc = self.findOne(cursorDescription.collectionName, {_id: id}); + newDoc = self._docFetcher.fetch(cursorDescription.collectionName, id, + op.ts.toString()); } else { newDoc = _.extend({_id: id}, op.o); }