Master
Master

Reputation: 2959

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

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?

Upvotes: 0

Views: 552

Answers (1)

Henrik Barratt Due
Henrik Barratt Due

Reputation: 5794

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...

Upvotes: 2

Related Questions