diff --git a/lib/cradle/database/index.js b/lib/cradle/database/index.js index 667352a..1c1ef71 100644 --- a/lib/cradle/database/index.js +++ b/lib/cradle/database/index.js @@ -30,10 +30,15 @@ Database.prototype.configureCacheFeed = function () { // remotely. if (this.opts.cache === 'follow') { var self = this; - this.changes(function (err, list) { + this.query({ + method: 'GET', + path: '', + query: {} + }, + function (err, summary) { var lastSeq = 0; - if (list && list.length !== 0) - lastSeq = list[list.length - 1]["seq"]; + if (summary && summary.update_seq !== 0) + lastSeq = summary.update_seq; self.cacheFeed = self.changes({ since: lastSeq, include_docs: true }); self.cacheFeed.on('change', function (change) { var id = change["id"];