Closed salus-sage closed 6 years ago
refer to puch db doc query https://pouchdb.com/2014/06/17/12-pro-tips-for-better-code-with-pouchdb.html pont no. 9 suggestion: instead of map reduce, below syntax to be used for querying.
var ddoc = createDesignDoc('by_timestamp', function (doc) { emit(doc.timestamp, doc.name); }); db.put(ddoc).then(function() {/* etc. */}); function getPostsSince(when) { return db.query('by_timestamp', {endkey: when, descending: true}); } function getPostsBefore(when) { return db.query('by_timestamp', {startkey: when}); } function getPostsBetween(startTime, endTime) { return db.query('by_timestamp', {startkey: startTime, endkey: endTime}); }
`
this upgrade is added in recent commits, issue should be resolved. awaiting confirmation from testing
By emitting the necessary properties and not the whole doc , the slow loading issue is resolved now
refer to puch db doc query https://pouchdb.com/2014/06/17/12-pro-tips-for-better-code-with-pouchdb.html pont no. 9 suggestion: instead of map reduce, below syntax to be used for querying.
`