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 15983D581 for ; Tue, 6 Nov 2012 02:48:51 +0000 (UTC) Received: (qmail 14444 invoked by uid 500); 6 Nov 2012 02:48:49 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 14358 invoked by uid 500); 6 Nov 2012 02:48:49 -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 14335 invoked by uid 99); 6 Nov 2012 02:48:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2012 02:48:48 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [216.97.235.45] (HELO krypton.lunarpages.com) (216.97.235.45) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2012 02:48:41 +0000 Received: from localhost ([127.0.0.1]:54611 helo=webmail.krypton.lunarpages.com) by krypton.lunarpages.com with esmtpa (Exim 4.77) (envelope-from ) id 1TVZDA-0007Q3-J8 for user@couchdb.apache.org; Mon, 05 Nov 2012 18:48:20 -0800 Received: from 24.63.141.87 ([24.63.141.87]) (SquirrelMail authenticated user aleoo@solarapex.com) by webmail.krypton.lunarpages.com with HTTP; Mon, 5 Nov 2012 21:48:20 -0500 Message-ID: In-Reply-To: <95FDB8AF-32C2-4056-9D3B-9FC05186F16C@charter.net> References: <99EA19FD-5ED6-4EDA-B538-2D78DCE47DFF@charter.net> <9D607BF7-197D-47C0-BCF8-3D225405C6CE@couchbase.com> <95FDB8AF-32C2-4056-9D3B-9FC05186F16C@charter.net> Date: Mon, 5 Nov 2012 21:48:20 -0500 Subject: Re: Exist test? From: "Alex G" To: user@couchdb.apache.org User-Agent: SquirrelMail/1.4.22 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - krypton.lunarpages.com X-AntiAbuse: Original Domain - couchdb.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - solarapex.com X-Virus-Checked: Checked by ClamAV on apache.org On Mon, November 5, 2012 14:40, Kevin Burton wrote: > I am mainly using it the context of initially populating a database. So > there isn't any danger of a race because there is only one user. I understand this does not answer your question directly. I guess, it depends on your particular use case, but I thought I'd mention this. Assuming you construct your key based on your unique attribute(s) I'm wondering whether it makes sense instead of preventing a new document from being created to go ahead and update the existing record. Then you could reconcile data discrepancies based on revisions. I assume it depends on how those duplicates got in your data in the first place. If those duplicates meant to be updates (or upserts rather), then revisions seem to me a better approach. Alex