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 E673DB21F for ; Mon, 2 Jan 2012 22:14:54 +0000 (UTC) Received: (qmail 14776 invoked by uid 500); 2 Jan 2012 22:14:53 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 14751 invoked by uid 500); 2 Jan 2012 22:14:53 -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 14743 invoked by uid 99); 2 Jan 2012 22:14:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jan 2012 22:14:53 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ziggythehamster@gmail.com designates 209.85.215.180 as permitted sender) Received: from [209.85.215.180] (HELO mail-ey0-f180.google.com) (209.85.215.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jan 2012 22:14:45 +0000 Received: by eaac11 with SMTP id c11so15052523eaa.11 for ; Mon, 02 Jan 2012 14:14:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=D9fYv2gcXh2nEb3jXkaJLO1Ne//IyG/QMdt9xdLDBsQ=; b=OcLxFZf2iqMGWKmmvIAOMN1Id5J3fGpdWaW4yXWB8cUviKVi0LSMvkf97yuaD5bH5j NUWCS506yCQqslZCZvffanIJC1/b7hJNOyh5m/zH7/Dhd8CTpJ8W1S3WCttiBBIlIsqm Ap442Xx11ltVODgtl6RuTqAEVJKivu2Rh3lGo= MIME-Version: 1.0 Received: by 10.204.7.81 with SMTP id c17mr11371475bkc.63.1325542465201; Mon, 02 Jan 2012 14:14:25 -0800 (PST) Sender: ziggythehamster@gmail.com Received: by 10.204.150.20 with HTTP; Mon, 2 Jan 2012 14:14:25 -0800 (PST) In-Reply-To: <4F022A95.1020005@gmail.com> References: <4EF45C4A.5080902@gmail.com> <4F0164FE.7050207@gmail.com> <4F01E3A1.2080402@gmail.com> <4F021A1D.4010502@gmail.com> <4F022A95.1020005@gmail.com> Date: Mon, 2 Jan 2012 16:14:25 -0600 X-Google-Sender-Auth: o5Va8GEj7WZTYTZfdRIxc7nzQQg Message-ID: Subject: Re: Modeling a tree in couchdb. From: Keith Gable To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=001517588540c5e78004b592e786 X-Virus-Checked: Checked by ClamAV on apache.org --001517588540c5e78004b592e786 Content-Type: text/plain; charset=ISO-8859-1 That's true, but in my case moving big branches doesn't happen. --- Keith Gable A+ Certified Professional Network+ Certified Professional Web Developer On Mon, Jan 2, 2012 at 4:07 PM, Jo-Erlend Schinstad < joerlend.schinstad@gmail.com> wrote: > Den 02. jan. 2012 22:53, skrev Keith Gable: > > The method I use is to have a field called "path", which contains a list >> of >> IDs, and the last item in the list/array is the current document's ID. The >> downside is that you have to assign the IDs yourself, but the upside is >> that it's easy to query. >> >> --- >> > > Right. But consider this list of elements: [1,2,3,4,5]. What happens if I > insert something before 3? Then, 3 becomes 4, 4 becomes 5 and 5 becomes 6. > If this list is a million entries long, then you would need to update > 999.997 documents. Then all those would need to be sent to all the other > databases, etc. That's the problem. For immutable trees, in the sense that > the structure and order doesn't change, your solution works nicely. > > Jo-Erlend Schinstad > > > --001517588540c5e78004b592e786--