incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthieu Rakotojaona <matthieu.rakotoja...@gmail.com>
Subject Re: suggestion for improvement
Date Thu, 19 Apr 2012 20:41:14 GMT
I think that managing versions/diff of a document is out of the scope
of couchDB (although one could argue about the versioning). If I were
you, I would store each new revision with a new UUID, link all these
revisions with some common id (the name of a post, ...)  and use it to
retrieve the diff.

You could use a view that emits [common_id,revision_for_this_document]
as a key to build an index of all the revs of a document, and retrieve
the diffs by using a _list function that queries the previous view
with keys like [common_id_of_interest,{}] to get all the revisions and
computes the diff. The advantage of doing it in a _list is that it is
done in the database, aka server-side.

In fact this is an interesting problem; I would be glad to know how
you end up solving it.

-- 
Matthieu RAKOTOJAONA

Mime
View raw message