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 6EF41D474 for ; Fri, 24 Aug 2012 18:04:56 +0000 (UTC) Received: (qmail 3179 invoked by uid 500); 24 Aug 2012 18:04:54 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 3103 invoked by uid 500); 24 Aug 2012 18:04: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 3093 invoked by uid 99); 24 Aug 2012 18:04:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Aug 2012 18:04:54 +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 jayson.barley@gmail.com designates 209.85.215.52 as permitted sender) Received: from [209.85.215.52] (HELO mail-lpp01m010-f52.google.com) (209.85.215.52) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Aug 2012 18:04:46 +0000 Received: by lage4 with SMTP id e4so1205379lag.11 for ; Fri, 24 Aug 2012 11:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=KBz4vBnSxkE1SJxjsGxoKD1AND8cJBCBn9Xtcf4/CY8=; b=tSiH3XpXpWwKK5qV6oHqCSqFi0go5XSPiXwC16mme0zmT49wKxr/Xb+diwjPijKo4l TsRV1jRI8BUlMla3SYJasLkQDKwUtUm7BqZJ62QXxQx8OoognYaCWIEjQu6R3OOkJy1E Djm3xKMvDsRQubDUjWSxIIQhEGMXg5lRR9xTV9mkx/6WU7A05tERDh3yvxUFpJKTkd1R j24T1PN1TsgN/t/uGO+Ir5WfqP2LwQmok6YulAR80PLiVJ8WAyWUowCjd6v9Ekkei/2J f0xUPRCrZMTwqiReRKVXc/F9i8V0qvy+j5AmGbnVYFcWGtuZ6Ltylg6Jg/jIUcvcFS9+ 1lSw== MIME-Version: 1.0 Received: by 10.152.148.195 with SMTP id tu3mr6738923lab.16.1345831466347; Fri, 24 Aug 2012 11:04:26 -0700 (PDT) Received: by 10.114.74.225 with HTTP; Fri, 24 Aug 2012 11:04:26 -0700 (PDT) In-Reply-To: References: Date: Fri, 24 Aug 2012 11:04:26 -0700 Message-ID: Subject: Re: CouchDB joins From: Jayson Barley To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=e89a8f2348557aadc704c806cec5 --e89a8f2348557aadc704c806cec5 Content-Type: text/plain; charset=ISO-8859-1 If you are only using a map function you could do this with a show function. If you are reducing, which you probably are, you could emit both documents if the id of the parent is in the child. This would be a simulated join that you could then reduce and process with a show function or on the client side. On Fri, Aug 24, 2012 at 10:41 AM, Andrey Kuprianov < andrey.kouprianov@gmail.com> wrote: > Actually, it would still be convenient to pull any document from within a > view based on some id in order to emit mixed value of both base document > and a dependent one. Oh, well.. Maybe in future releases. > > On Sat, Aug 25, 2012 at 1:27 AM, Andrey Kuprianov < > andrey.kouprianov@gmail.com> wrote: > > > Yup, that's right! I have never actually looked at that before, Thanks > > Jayson. > > > > > > On Sat, Aug 25, 2012 at 1:21 AM, Jayson Barley >wrote: > > > >> It sounds like you want a view that emits some values and emits a doc > >> based > >> on the id contained in some field. If I understand this correctly you > >> should be able to use a linked document to accomplish what you need. > >> > >> > >> > http://wiki.apache.org/couchdb/Introduction_to_CouchDB_views#Linked_documents > >> > >> > >> On Fri, Aug 24, 2012 at 10:11 AM, Andrey Kuprianov < > >> andrey.kouprianov@gmail.com> wrote: > >> > >> > What is the reason that we cannot pull an arbitrary document from > >> within a > >> > design document view function? > >> > > >> > > > > > --e89a8f2348557aadc704c806cec5--