Getting a complete list of fixes at the document level with CouchDB-Python?

I worked couchdb-python ( http://code.google.com/p/couchdb-python/ ) and I was wondering if I have a way to get a complete list of changes that have occurred at the document level?

Suppose I have a database called "movies" and contains several documents. Each of my documents has more than 3 versions.

Can I get my documents based on the changes?

If so, how? I have not seen any obvious method for this using CouchDB-Python

+7
source share
2 answers

I'm not sure about couchdb-python, however you can get all the known history of document changes via the HTTP API.

Find out all of this in the CouchDB Document .

Normal query:

$ curl jhs.couchone.com/db/doc { _id: 'doc', _rev: '3-825cb35de44c433bfb2df415563a19de' } 

Add ?revs=true to see an array of old versions.

 $ curl jhs.couchone.com/db/doc?revs=true { _id: 'doc', _rev: '3-825cb35de44c433bfb2df415563a19de', _revisions: { start: 3, ids: [ '825cb35de44c433bfb2df415563a19de', '7051cbe5c8faecd085a3fa619e6e6337', '967a00dff5e02add41819138abb3284d' ] } } 

You can also add ?revs_info=true for more information about the changes, for example, are they available (i.e. they were added after the last compaction, and you can get them).

 $ curl jhs.couchone.com/db/doc?revs_info=true { _id: 'doc', _rev: '3-825cb35de44c433bfb2df415563a19de', _revs_info: [ { rev: '3-825cb35de44c433bfb2df415563a19de', status: 'available' }, { rev: '2-7051cbe5c8faecd085a3fa619e6e6337', status: 'available' }, { rev: '1-967a00dff5e02add41819138abb3284d', status: 'available' } ] } 
+7
source

The Database.revisions method may be what you want, http://code.google.com/p/couchdb-python/source/browse/couchdb/client.py#545 .

+2
source

All Articles