Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 62552 invoked from network); 1 Apr 2010 14:00:12 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Apr 2010 14:00:12 -0000 Received: (qmail 17975 invoked by uid 500); 1 Apr 2010 14:00:11 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 17944 invoked by uid 500); 1 Apr 2010 14:00:11 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 17936 invoked by uid 99); 1 Apr 2010 14:00:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Apr 2010 14:00:11 +0000 X-ASF-Spam-Status: No, hits=-1.4 required=10.0 tests=AWL,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [74.55.86.74] (HELO smtp.webfaction.com) (74.55.86.74) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Apr 2010 14:00:03 +0000 Received: from [192.168.0.9] (adsl-82-75-29.jax.bellsouth.net [98.82.75.29]) by smtp.webfaction.com (Postfix) with ESMTP id 402D2390DFC for ; Thu, 1 Apr 2010 08:59:42 -0500 (CDT) Subject: Re: Using _rev in application logic From: Alan Boyce To: user@couchdb.apache.org In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Thu, 01 Apr 2010 09:59:38 -0400 Message-ID: <1270130378.3651.6.camel@bigmac> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit Hi Moritz I wouldn't use _rev, see Jan's response. I would use update handlers. See here: http://wiki.apache.org/couchdb/How_to_intercept_document_updates_and_perform_additional_server-side_processing So you could create a revision in the document on update. { title: "I'm a document", body: "This couchdb stuff is cool." revisions: [{title: "I'm a document", body:"this couchdb stuff is cool."}], update_note: "fixed capitalization of 'this' in body" } best, alan On Thu, 2010-04-01 at 14:32 +0200, Moritz Post wrote: > Hi CouchDB people > > I am currently playing with the couchdb and pretty impressed by several of > the feature on offer. Great job so far. While reading up on various web > resources i have come to conclude that it is discouraged to use the _rev > field for application related logic since the revisions are removed when > compacting and they are not replicated when using replication. > > Looking at my possible usecase however, i would very much like to use the > _rev key to track changes in my document. So here are several questions > regarding that topic: > > 1. Is it generally discouraged to use the _rev in application logic? > 2. Is compacting something i would like to do for other reasons than to > remove older revisions (so i could basically not do it) > 2. Is it possible to somehow also replicate the revision while replicating? > 3. Is it good practice to use the _rev field in views? > > Any other clarifications in regards to _rev are also welcome. > > Thanks in advance and keep up the good work > > Greets > Moritz