Is there a way to get all revisions of a document in PouchDB when using the change feed?

后端 未结 2 1335
無奈伤痛
無奈伤痛 2021-01-16 06:50

I\'m fiddling around with PouchDB at the moment. I use it as a way to store data locally without it being linked to CouchDB. What I\'ve been trying to do is to create a reve

2条回答
  •  终归单人心
    2021-01-16 07:15

    With some help of macrog I've found a way to do what I wanted to do. Short summary I wanted a way to get all revisions of my documents, including the ones which had been removed. This is what I use now:

    db.get(String(id), {
        revs: true, 
        open_revs: 'all' // this allows me to also get the removed "docs"
      }).then(function(found) {
        console.log(found);
      });
    

    Granted I no loger use db.changes() to get all the revisions of a document. But at least I'm able to do what I wanted to do.

提交回复
热议问题