From 6573ccb50276f7fcf1602f2c2b2499c85bd7de8a Mon Sep 17 00:00:00 2001 From: GOOLZ Date: Tue, 1 Jan 2019 11:45:01 +0330 Subject: [PATCH] Update server.js for big data observeChanges should be disabled https://github.com/aslagle/reactive-table/issues/467 --- lib/server.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/server.js b/lib/server.js index eec325d..9cc6685 100644 --- a/lib/server.js +++ b/lib/server.js @@ -33,8 +33,11 @@ ReactiveTable.publish = function (name, collectionOrFunction, selectorOrFunction options.fields = settings.fields; } var pageCursor = collection.find(filterQuery, options); - var fullCursor = collection.find(filterQuery); - var count = fullCursor.count(); + //for big data observeChanges should be disabled + if (!(settings || {}).disablePageCountReactivity) { + var fullCursor = collection.find(filterQuery); + } + var count = collection.find(filterQuery).count(); var getRow = function (row, index) { return _.extend({