Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 79830 invoked from network); 15 Nov 2010 15:11:45 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 15 Nov 2010 15:11:45 -0000 Received: (qmail 49305 invoked by uid 500); 15 Nov 2010 15:12:14 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 49227 invoked by uid 500); 15 Nov 2010 15:12:14 -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 49219 invoked by uid 99); 15 Nov 2010 15:12:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Nov 2010 15:12:13 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of zachary.zolton@gmail.com designates 209.85.212.52 as permitted sender) Received: from [209.85.212.52] (HELO mail-vw0-f52.google.com) (209.85.212.52) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Nov 2010 15:12:07 +0000 Received: by vws3 with SMTP id 3so979515vws.11 for ; Mon, 15 Nov 2010 07:11:46 -0800 (PST) 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=1fhTdbra/dH/yohIUE2AWDC2DhGo/ckoR5Svv2L66sw=; b=pJCKnEoHx7nuPWueaSAGV/ayuNKs0YeznJy5rZoh+sWFBqGKdoqwkkLb6zJ9ysqpto 7ZvXi8/psoyMFOnZWNDA5XMtaPAZpo+W2ew/AffD+1uPHrLSMGSmzOwxFvMg+2d9ZPJw f6DRBI8WjJSGROwzdTUKQV7el1HovruDl3FZE= 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=DN/Z8b/7c+CnB7b+2MFmhS8P8LIKLYiNN/8v5qZCfdE6l8NbTOrnAQFje4/32DY5Mh iom4NBYzX+XQqD0/YCb6w/rihtG+kZOdbaWzpZIs79Ugyf6x3t1EFBuiWdZ8MaTkrdhG wlIXs04/4NPvwGVGd4dIxf/2Ylj7/JSjcbFVM= Received: by 10.229.241.78 with SMTP id ld14mr5179015qcb.188.1289833906137; Mon, 15 Nov 2010 07:11:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.246.21 with HTTP; Mon, 15 Nov 2010 07:11:25 -0800 (PST) In-Reply-To: References: From: Zachary Zolton Date: Mon, 15 Nov 2010 09:11:25 -0600 Message-ID: Subject: Re: Update handler doc ids To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 > Thanks, got it working. This is good stuff. Your welcome! Sorry, for the delayed response. > Hmm, I don't follow. I have a doc for user foobar with "_id:foobar". > If I had a second type of document, say one type with user's blog > posts and another with comments by same user, then do you mean I'd > need to add a field unique to usernames because the ID has already > been used? I'm saying that if you're going to use a natural key as the ID of a document that you should namespace it. Like so: { "_id": "user:foo", "type": "user", "full_name": "Foo Baz Barington" } That way, you can also have another kind of document, in a different ID namespace, with the same natural key value. So, for instance, their could be a book called Foo: { "_id": "book:foo", "type": "book", "title": "Foo" } And their IDs wont collide.