On Fri, Sep 25, 2009 at 8:34 PM, go canal <[email protected]> wrote: >>>When you compact the database it removes all but the most recent version of >>>each document. > > > Does this mean that if I want to support document version feature, I can not > compact the database ? >
Applications should not depend on controlling compaction schedules. Only the most recent version is replicated, so if you run in a cluster it's like it's compacting all the time. > Let's say I am working on a Word document, I upload it as an attachment; I > need to have a list of all versions for this file and can download any of > previous version. > > Is this how I should model it in CouchDB: > - have a version field, not using the CouchDB _rev. update the version in my > application. > - when uploading the modified Word document, a doc with a different ID is > created. So compacting a DB will not affect them. > but how to get a list of all versions of this document ? I need to use > another field to identify them, for example, another application generated ID. > > Is this the general practice ? I am sure supporting versioning is a common > request, so appreciate if you can provide some advices.. > thanks, > canal > > > -- Chris Anderson http://jchrisa.net http://couch.io
