Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 11818 invoked from network); 27 May 2010 04:39:02 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 May 2010 04:39:02 -0000 Received: (qmail 11156 invoked by uid 500); 27 May 2010 04:39:01 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 10996 invoked by uid 500); 27 May 2010 04:39:00 -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 10987 invoked by uid 99); 27 May 2010 04:39:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 May 2010 04:39:00 +0000 X-ASF-Spam-Status: No, hits=-0.2 required=10.0 tests=AWL,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 mrtrick@gmail.com designates 209.85.160.52 as permitted sender) Received: from [209.85.160.52] (HELO mail-pw0-f52.google.com) (209.85.160.52) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 May 2010 04:38:54 +0000 Received: by pwi3 with SMTP id 3so304397pwi.11 for ; Wed, 26 May 2010 21:38:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=XpHMEQDw4EJCj2TU8Nk1GA8Mc1TbVcTBzWsc3vm4Av8=; b=o5lqUoz8x9jYe4o+obh1xCIDmw3rNnF7zAziZFKLrYDB9ZIdhZ+wAgufoLeHFoY1v2 tVvPGFHD76oJ8HHsz2VtUFN5DiYfJVdwiIeozCYp5+xZwZthwyGMd7am8Bt8A5lZlWJD cbkIpwuzdK/CiHox+97iPeT8YuDOvjOORbSuk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=u0j6BrQYV+MWAiH4sZwqM2BGAOtToNhlSjleSVKnZlJIMEkFy0j3v+uBidjThRyGdO RNGhj234vxpIHasgsEpieN8qHAhD51uQOIW5cU1teMHR6gJXwxONeu09Tv/Wp/YsBpZe WIw6IXz4vZ1F/2GxxfXhZMMLQFoqb5LKYjIfg= Received: by 10.142.117.15 with SMTP id p15mr6549190wfc.199.1274935105631; Wed, 26 May 2010 21:38:25 -0700 (PDT) Received: from [138.25.13.215] (dhcp-13-215.it.uts.edu.au [138.25.13.215]) by mx.google.com with ESMTPS id c22sm6577743wam.6.2010.05.26.21.38.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 26 May 2010 21:38:22 -0700 (PDT) Message-ID: <4BFDF739.90000@gmail.com> Date: Thu, 27 May 2010 14:38:17 +1000 From: Patrick Barnes User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4 MIME-Version: 1.0 To: user@couchdb.apache.org Subject: Re: Delete document Tree Structure References: In-Reply-To: Content-Type: text/plain; charset=windows-874; format=flowed Content-Transfer-Encoding: 8bit How do you currently organise the documents into a tree and display them? For my trees, I have a 'hierarchy' array attribute that basically holds a tree address, eg: A = {"_id":"A", .... "hierarchy":["A"]}; B = {"_id":"B", .... "hierarchy":["B"]}; C = {"_id":"C", .... "hierarchy":["B","C"]}; D = {"_id":"D", .... "hierarchy":["A","D"]}; E = {"_id":"C", .... "hierarchy":["B","E"]}; F = {"_id":"C", .... "hierarchy":["B","E","F"]}; If you then create a view that emits the hierarchy attribute as the key, it will automatically sort them into lexicographic (tree) order. If you want to delete B+descendants, you: 1. Query that view with: startkey=["B"] & endkey=["B",{}] to get the B document and every descendant of B, 2. Delete them all. On 27/05/2010 1:48 PM, Aun... ��Ǿ��� wrote: > > > Hi, > > I design document in couchdb to have relation something like > > directory > | > A---------D > | > B---------C > | > | > E ------F > > if i would like to http (DELETE B) will delete all down documents what is the possible solution to use. > > 1. can i create view and find relation and delete all of them ? > 2. get relation by higher programming api (C#,PHP) and then delete each one? > 3. Do you have any solution to suggest on this.....? > > > Thanks, > A. > > > > _________________________________________________________________ > Hotmail: ��ԡ������ſ�� ������Ͷ���� �������ó����� > https://signup.live.com/signup.aspx?id=60969