From fb2886d88ad2b9dbaf086b9abdca5e72de439bb4 Mon Sep 17 00:00:00 2001 From: Slava Kim Date: Tue, 3 Dec 2013 15:27:47 -0800 Subject: [PATCH] Don't use oplog tailing for queries with unsupported fields projection --- packages/mongo-livedata/oplog_observe_driver.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/mongo-livedata/oplog_observe_driver.js b/packages/mongo-livedata/oplog_observe_driver.js index 160182b0d0..a44a0e918d 100644 --- a/packages/mongo-livedata/oplog_observe_driver.js +++ b/packages/mongo-livedata/oplog_observe_driver.js @@ -322,6 +322,11 @@ OplogObserveDriver.cursorSupported = function (cursorDescription) { // not, and we don't track that information when doing oplog tailing. if (options.limit || options.skip) return false; + // If a fields projection option is given check if it is supported by + // minimongo (some operators are not supported). + if (options.fields && !LocalCollection._supportedProjection(options.fields)) + return false; + // For now, we're just dealing with equality queries: no $operators, regexps, // or $and/$or/$where/etc clauses. We can expand the scope of what we're // comfortable processing later. ($where will get pretty scary since it will