Retrieve a CouchDB document's previous revision with revision id?

543 Views Asked by At

How can I retrieve a couchDB document with certain revision? I am using Ektorp 1.2.2 API for Android.

I just want to pass the docId and revision number somewhere to access a particular document's revision.

I am not getting exact procedure to do that anywhere, How can I achieve this?

1

There are 1 best solutions below

0
On

If you know the revision you can load it like this:

String id = ...
String rev = ...
Sofa sofa = db.get(Sofa.class, id, rev);

This will work provided that your revision is still in the db...