couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <>
Subject Re: How to find the change sequence of a document's revision
Date Wed, 19 Dec 2012 01:59:45 GMT

On Dec 18, 2012, at 1:02 PM, Ciprian Dorin Craciun <> wrote:

>    But just out of curiosity, why doesn't a previous revision retain
> it's change sequence number? (At least for those still available?)
> Because at some point in time they did have such a sequence.

In the database structure, the sequence number is a property of a document, not a revision.
Every time a document is updated, its sequence number property is assigned the next available
sequence number. The old sequence number is lost.

(TouchDB does this differently; it does associate sequence numbers with revisions so it can
look up old revisions by sequence number. But I suspect that at some point I’ll be rewriting
the storage layer of TouchDB to work more like CouchDB.)

View raw message