lanto03 / couchdb-python

Automatically exported from code.google.com/p/couchdb-python
Other
0 stars 0 forks source link

Patch to add an iterator of all existing revisions of a document #99

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This is against CouchDB-0.6.  I added an iterator, Database.getallrevs,
that retrieves all existing revisions of a document.  For example:

server = Server('http://db1:5984/')
db = server['example']
for rev in db.getallrevs('foo'):
    print rev

currently prints something like:

<Document u'foo'@u'4-3918188839' {u'baz': 3, u'foo': 4, u'bar': 2}>
<Document u'foo'@u'3-700753686' {u'baz': 3, u'foo': 1, u'bar': 2}>
<Document u'foo'@u'2-1000638046' {u'foo': 1, u'bar': 2}>
<Document u'foo'@u'1-1401731762' {u'foo': 1}>

when run against a test database here.

Original issue reported on code.google.com by kirk.str...@gmail.com on 10 Nov 2009 at 5:02

Attachments:

GoogleCodeExporter commented 8 years ago
Fixed in r483013528c. Thanks for the patch!

Original comment by djc.ochtman on 12 Dec 2009 at 10:30