Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9B72010F25 for ; Sun, 10 Nov 2013 21:52:11 +0000 (UTC) Received: (qmail 24474 invoked by uid 500); 10 Nov 2013 21:52:09 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 24438 invoked by uid 500); 10 Nov 2013 21:52:09 -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 24430 invoked by uid 99); 10 Nov 2013 21:52:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Nov 2013 21:52:09 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kxepal@gmail.com designates 209.85.212.181 as permitted sender) Received: from [209.85.212.181] (HELO mail-wi0-f181.google.com) (209.85.212.181) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Nov 2013 21:52:04 +0000 Received: by mail-wi0-f181.google.com with SMTP id m19so1434617wiv.8 for ; Sun, 10 Nov 2013 13:51:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=HdjrEEYyGW5Al3s+risBCsaPKOA6jXNwg2ZEr08nO0I=; b=XRMG3WykwB+0j3yKy11Wvs4D/XC2905UI4VD0XpDkKQ+4mXGXSiD1nKLbwJRn6jiXj GNoa7QUC+kL8jsDzCLGEgCXRJxZ+ljXnE0X4exkt4fLnQ/UbadRYXV/XcyWWyAi29DwL XcuPkMenSMjrwablcCJAzpT6lpKinkzsr6ELBKZffBj2W3/ATQ0hbKDF+LBvlPFoGwTz 84K80tdI4YEMR4b24iaac9Z/RiMQcoQEwMgYZCZ7KbKLORJTi7VsiJZvILXBLY3/cK+Y WYiXK8KMB2vI+CVE5KMcgYTB+tU27+oM6LKX2AriqWigNma1/6szaaVm9xKkKCE3bL6T RqfA== MIME-Version: 1.0 X-Received: by 10.180.79.230 with SMTP id m6mr9974335wix.19.1384120303989; Sun, 10 Nov 2013 13:51:43 -0800 (PST) Received: by 10.180.24.99 with HTTP; Sun, 10 Nov 2013 13:51:43 -0800 (PST) In-Reply-To: References: Date: Mon, 11 Nov 2013 01:51:43 +0400 Message-ID: Subject: Re: overwrite document without revision? From: Alexander Shorin To: "user@couchdb.apache.org" Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org On Mon, Nov 11, 2013 at 1:36 AM, Ryan Mohr wrote: > Can you expand on this more or point me to documentation that covers > this in detail? >From wiki link you posted: > rather than being the parent revision ID to be matched against, it's the existing revision ID that will be saved as-is into the database. It's easy to see: [~]$ curl http://localhost:5984/db/foo { "_id": "foo", "_rev": "3-00e7ae9eeb50cabd81126e9f39b871cf" } [~]$ curl -X PUT http://localhost:5984/db/foo -d '{"bar":"baz","_rev":"1-ABC"}' -H "Content-Type:application/json" {"error":"conflict","reason":"Document update conflict."} [~]$ curl -X PUT 'http://localhost:5984/db/foo?new_edits=false' -d '{"bar":"baz","_rev":"1-ABC"}' -H "Content-Type:application/json" {"ok":true,"id":"foo","rev":"1-ABC"} [~]$ curl -X PUT 'http://localhost:5984/db/foo?new_edits=false' -d '{"bar":"baz","_rev":"9-CDE"}' -H "Content-Type:application/json" {"ok":true,"id":"foo","rev":"9-CDE"} [~]$ curl 'http://localhost:5984/db/foo?open_revs=all' -H "Accept:application/json" [ { "ok": { "_id": "foo", "_rev": "9-CDE", "bar": "baz" } }, { "ok": { "_id": "foo", "_rev": "3-00e7ae9eeb50cabd81126e9f39b871cf" } }, { "ok": { "_id": "foo", "_rev": "1-ABC", "bar": "baz" } } ] -- ,,,^..^,,,