Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 95355 invoked from network); 12 Sep 2010 13:25:33 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Sep 2010 13:25:33 -0000 Received: (qmail 30803 invoked by uid 500); 12 Sep 2010 13:25:32 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 30599 invoked by uid 500); 12 Sep 2010 13:25:29 -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 30588 invoked by uid 99); 12 Sep 2010 13:25:29 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Sep 2010 13:25:28 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ido.ran@gmail.com designates 209.85.214.180 as permitted sender) Received: from [209.85.214.180] (HELO mail-iw0-f180.google.com) (209.85.214.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Sep 2010 13:25:07 +0000 Received: by iwn8 with SMTP id 8so7138624iwn.11 for ; Sun, 12 Sep 2010 06:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=QaX13Ilw/+oip6UI7fpx1B/n/Hrho4mlUn3Fjk6B2fY=; b=o5vwfC+y0OiKucOheK5e1eteziCN0NipYuXUSLbZcgD1BliiD64pBWVs/jPlZHso4K VjgENOdPvqEk0hzWwes82Qr55hYpfuJ2FQO1FAc1qdxmO4xFJSuUWqfqf08DxuTHwQJa Lhaw5gqdRaSmKylSmQfFxyfPcShSZqh/z8i6s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=iYsO9AzbSdTUG2sSwPAX3s4oEJ/10hE0SWZKJcKl7p9HPyXGxuxaGy5nGFSSZEa+W6 1/X/UHi+tMbDCB5xymBPPZ6EO/3PZ5kXideCyRfe+yuGL9tYrXuXT+8ea9BdrUE9XmQO 1AiFrYDU90HGsv4WtVC0g1lvqgCQcz20cu1rQ= Received: by 10.231.167.130 with SMTP id q2mr4266993iby.163.1284297886228; Sun, 12 Sep 2010 06:24:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.168.14 with HTTP; Sun, 12 Sep 2010 06:24:25 -0700 (PDT) In-Reply-To: References: From: Ido Ran Date: Sun, 12 Sep 2010 15:24:25 +0200 Message-ID: Subject: Re: Revsion Explained To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0050450143dd4b6cd604900fe712 X-Virus-Checked: Checked by ClamAV on apache.org --0050450143dd4b6cd604900fe712 Content-Type: text/plain; charset=UTF-8 Thank you for the answer. I though it is possible to compare two _rev fields of two documents and based on the hash part (not the integer) to tell if they have the same content. I guess it is not possible. Ido On Sun, Sep 12, 2010 at 3:14 PM, Sebastian Cohnen < sebastiancohnen@googlemail.com> wrote: > Hi Ido, > > consider the _rev token as an opaque value necessary for the mvcc (I'd call > it mvcc-token, since "revision" is often misunderstood). The hash algorithm > may even change someday. AFAIK it contains the document itself and also its > history (at least parts of it). The algorithm ensures that the same document > with the same history result in the same _rev token even on two different > nodes. This behavior is required for conflict detection/resolution. > > Best > > Sebastian > > > On 12.09.2010, at 14:43, Ido Ran wrote: > > > Hi, > > I've read that the _rev fiel in each document is composed of two parts - > > integer which increment by 1 on each change and MD5 hash of the JSON of > the > > document. > > What part of the JSON is included in that hash? > > > > I've created a new document with _id of "foo" and single field name > "start" > > with value "99". I've save the document and it got _rev of > > "1-b563730fcffb6583ff48980c1533e439". > > I didn't change anything, just hit save again in Futon and not the _rev > is > > "2-75a41bb3bc74cb4d768466efa2a0c1ca". > > If I hit save again I get another hash. > > > > Why is that? > > > > Thank you, > > Ido > > --0050450143dd4b6cd604900fe712--