Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

listening to pouchdb changes in particular view returns all documents

$
0
0

Trying to retrieve changes in pouchDB for particular view, but still receiving allDocs ... what am I doing wrong? Havent found any tutorials or detailed info how to do this, except pouch API doc (http://pouchdb.com/api.html#changes). I've tested view and filter options with no luck.

This view is designed and saved as /notes

function(doc) {
  if (doc.model == 'note') {
    emit(doc._id, doc);
  }
}

live changes feed:

pouch.changes({ 
  live: true,
  view: '_view/notes'
})
.on('change', function handleUpdate(change) {

  // log changed document
  pouch.get(change.id).then(function(row) {
    console.log(row);
  }

})

Maybe the view path is wrong...? Thanks for any help.


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>