From 73b45f2fa2b4abcb2e88a0e319d722b50a319bda Mon Sep 17 00:00:00 2001 From: David Glasser Date: Thu, 10 Oct 2013 17:16:36 -0700 Subject: [PATCH] Actually use Slava's function in oplog tailing. Tests pass, but I have not confirmed that it actually has the desired end-to-end effect. --- packages/mongo-livedata/oplog.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/mongo-livedata/oplog.js b/packages/mongo-livedata/oplog.js index e3ed2841e5..a182a9f442 100644 --- a/packages/mongo-livedata/oplog.js +++ b/packages/mongo-livedata/oplog.js @@ -137,8 +137,13 @@ MongoConnection.prototype._observeChangesWithOplog = function ( LocalCollection._modify(newDoc, op.o); handleDoc(id, newDoc); } else { - // XXX for not-currently-published docs, if we can guarantee the - // irrelevance of the change, we can skip it + // If the selector is not affected by the modifier, no need to do + // anything! + if (!LocalCollection._isSelectorAffectedByModifier( + cursorDescription.selector, op.o)) { + return; + } + curiousity.set(id, op.ts.toString()); beCurious(); return;