Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 15094 invoked from network); 26 Jul 2010 21:38:56 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Jul 2010 21:38:56 -0000 Received: (qmail 23023 invoked by uid 500); 26 Jul 2010 21:38:55 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 22992 invoked by uid 500); 26 Jul 2010 21:38:54 -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 22984 invoked by uid 99); 26 Jul 2010 21:38:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jul 2010 21:38:54 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [74.125.82.54] (HELO mail-ww0-f54.google.com) (74.125.82.54) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jul 2010 21:38:45 +0000 Received: by wwb17 with SMTP id 17so271851wwb.23 for ; Mon, 26 Jul 2010 14:38:24 -0700 (PDT) Received: by 10.227.68.207 with SMTP id w15mr7940308wbi.75.1280180300984; Mon, 26 Jul 2010 14:38:20 -0700 (PDT) Received: from [192.168.1.115] (host86-164-43-29.range86-164.btcentralplus.com [86.164.43.29]) by mx.google.com with ESMTPS id w14sm2276419weq.9.2010.07.26.14.38.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 26 Jul 2010 14:38:19 -0700 (PDT) From: John Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Linked Documents Date: Mon, 26 Jul 2010 22:38:17 +0100 Message-Id: To: user@couchdb.apache.org Mime-Version: 1.0 (Apple Message framework v1081) X-Mailer: Apple Mail (2.1081) X-Virus-Checked: Checked by ClamAV on apache.org Hi I have a Use Case where I store an Account Tree in the database. Each = Account Node points to its parent and I can resolve the tree using = several database queries by getting the account then its parent then = its parents parent, I guess you get the idea! We store data as attributes in these account objects and inheritance is = used to easily propogate attributes down the account tree and override = them at each node as required. I've just been reading the wiki and seen a nice feature where I can emit = index entries with foreign id's which is great if I already know them in = the doc my map function is working on however I would prefer to just = reference my parent and then *follow* that link to get the parent doc = and retrieve it's parent id from there. So I guess what I'm trying to ask for here is whether I can retrieve = another document from the database, by id, from within the map function = in a view? I can see lots of other places in our design where this could be really = useful especially for validation of referenced id's within documents. Thanks John=