couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <>
Subject Is it OK to interpret the generation count in a revision ID?
Date Tue, 12 Jul 2011 20:26:36 GMT
I’ve been assuming that document revision IDs are opaque, that the generation count prefix
(“1-“, “2-“, etc.) is purely for troubleshooting. (I think I asked about this before.)

But now I see that the _revisions array returned with a document (with a “?revs=true”
query string) removes those generation prefixes and requires you to re-attach them to generate
useable revision numbers:

$ curl '’
   "_revisions”: {
       "ids”: [

In other words, the actual revision IDs are
so to get those I have to add code to iterate the “ids” array and prepend the generation
number to each string.

Given that this format is baked into the protocol, may I rely on it for other purposes? It
would be very useful to be able to look at two revision IDs and determine some (partial) ordering.
I’m aware that conflicts mean that there’s no true ordering, but partial is better than

View raw message