lib/cursor.js
function updated(docs) {
    // Refresh if any of the objects: have an ID which is in our results OR they match our query (this.query)
    var shouldRefresh = false;
    docs.forEach(function(doc) { // Avoid using .some since it would stop iterating after first match and we need to set _prefetched
      var interested = self._count || self._ids[doc._id] || document.match(doc, self.query); // _count queries never set _ids
      if (interested) self._prefetched[doc._id] = doc;
      shouldRefresh = shouldRefresh || interested;
    });
    if (shouldRefresh) refresh();
  }
function updated(docs) {
    // Refresh if any of the objects: have an ID which is in our results OR they match our query (this.query)
    var shouldRefresh = false;
    docs.forEach(function(doc) { // Avoid using .some since it would stop iterating after first match and we need to set _prefetched
      var interested = self._count || self._ids[doc._id] || document.match(doc, self.query); // _count queries never set _ids
      if (interested) self._prefetched[doc._id] = doc;
      shouldRefresh = shouldRefresh || interested;
    });
    if (shouldRefresh) refresh();
  }
function updated ( docs ) { // Refresh if any of the objects: have an ID which is in our results OR they match our query (this.query) var shouldRefresh = false ; docs . forEach ( function ( doc ) { // Avoid using .some since it would stop iterating after first match and we need to set _prefetched var interested = self . _count || self . _ids [ doc . _id ] || document . match ( doc , self . query ) ; // _count queries never set _ids if ( interested ) self . _prefetched [ doc . _id ] = doc ; shouldRefresh = shouldRefresh || interested ; } ) ; if ( shouldRefresh ) refresh ( ) ; }
Watch for changes
Watch for changes