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 93764D6AE for ; Mon, 5 Nov 2012 20:00:57 +0000 (UTC) Received: (qmail 57929 invoked by uid 500); 5 Nov 2012 20:00:56 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 57825 invoked by uid 500); 5 Nov 2012 20:00:56 -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 57817 invoked by uid 99); 5 Nov 2012 20:00:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2012 20:00:56 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jens@couchbase.com designates 206.225.164.29 as permitted sender) Received: from [206.225.164.29] (HELO EXHUB020-2.exch020.serverdata.net) (206.225.164.29) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2012 20:00:48 +0000 Received: from EXVMBX020-1.exch020.serverdata.net ([169.254.4.103]) by EXHUB020-2.exch020.serverdata.net ([206.225.164.29]) with mapi; Mon, 5 Nov 2012 12:00:27 -0800 From: Jens Alfke To: "user@couchdb.apache.org" Date: Mon, 5 Nov 2012 12:00:27 -0800 Subject: Re: Exist test? Thread-Topic: Exist test? Thread-Index: Ac27kDKbQBQ+ZM8UQDy7UNzfIT+2pw== Message-ID: References: <99EA19FD-5ED6-4EDA-B538-2D78DCE47DFF@charter.net> <9D607BF7-197D-47C0-BCF8-3D225405C6CE@couchbase.com> <95FDB8AF-32C2-4056-9D3B-9FC05186F16C@charter.net> <3F2385CF-51CD-4A6F-BB41-DE730655BBCF@charter.net> In-Reply-To: <3F2385CF-51CD-4A6F-BB41-DE730655BBCF@charter.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org On Nov 5, 2012, at 11:53 AM, Kevin Burton wrote: > So if I create a document that already exists how does the database know = that it already exists to give me a 409 error? If you PUT a document, and the body of your request has no =91_rev=92 prope= rty, it=92s an initial creation of a new document. The request will fail if= there is already a document with that ID in the database. (CouchDB can tel= l this apart from an update request because you didn=92t include the docume= nt=92s existing =91_rev=92 in the request.) If you=92re using POST, that by definition always creates a new document (w= ith a randomly-assigned ID), so it=92s meaningless to say whether the docum= ent already exists. > How do I establish a view? Won't I run into the same problem by creating = a view that already exists (via the DesignDocument)? Sorry, I don=92t understand the question. Maybe you should back up and describe what you=92re trying to do in more de= tail. =97Jens=