From user-return-4024-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri Mar 13 12:36:59 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 29019 invoked from network); 13 Mar 2009 12:36:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Mar 2009 12:36:59 -0000 Received: (qmail 4143 invoked by uid 500); 13 Mar 2009 12:36:57 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 4110 invoked by uid 500); 13 Mar 2009 12:36:57 -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 4099 invoked by uid 99); 13 Mar 2009 12:36:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Mar 2009 05:36:57 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of adam.groves@gmail.com designates 72.14.220.153 as permitted sender) Received: from [72.14.220.153] (HELO fg-out-1718.google.com) (72.14.220.153) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Mar 2009 12:36:48 +0000 Received: by fg-out-1718.google.com with SMTP id 19so812966fgg.3 for ; Fri, 13 Mar 2009 05:36:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=hKFmlL9/iD1crBLtzB34krNBnysBHxcPVCuC3C/z8xg=; b=HN0chpTAVntzW++Hgu8h0/IAmSlqcqUoH7rtig0SlkXdwrRPovw6s6PsLe0zSCD1f6 /KBtBcIF+lpy2Cb76zlswMMp3tdQUj6f+ijbUsuzN+jgc2beGOY0d3bqWsgelhJ0zhVY J4kC/QpfcV85Ptge6Se0XedU3UYvkFmF588OE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=gO16uBuRxspwgrveR9/Q+/N/OSkYzLvbyxmCIng05p9myaMCU7e2HqalAJ0ir3vrWi rlX1QwRzkS6cfwihqcXDHqjdPWWMZx7dwBCKIqSSFR+DylHUSiui1Z5vfe2ZQDUzfVOA q6WMaJor8LCODpXG5NYjJa3Kf7gdUjwNNG5mw= MIME-Version: 1.0 Received: by 10.86.51.10 with SMTP id y10mr1083412fgy.51.1236947787832; Fri, 13 Mar 2009 05:36:27 -0700 (PDT) In-Reply-To: <41139fcb0903130459td4f3d40ic4f418d7842c14ba@mail.gmail.com> References: <41139fcb0903130459td4f3d40ic4f418d7842c14ba@mail.gmail.com> Date: Fri, 13 Mar 2009 13:36:27 +0100 Message-ID: Subject: Re: equivalent of JOINs in couchdb? From: Adam Groves To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Anand, Try this View: function(doc) { emit([doc['type'], doc['publisher'], doc['author']] null); } Query: ../view_name?key=["book", "penguin", "Rowling"] Regards Adam 2009/3/13 Anand Chitipothu : > Hi, > > I have been reading about couchdb and trying understand how it works. > One thing that i'm unable to understand is how to do equivalent of > JOINs in couchdb. > > Let me explain what I need with an example. > I want to store books in couchdb with each book having title, authors, > isbn, lccn, publisher and many other fields. > I would like to be able to query the system for any combination of > these. some thing like: > > type="book" and publisher="foo" and author="bar > type="book" and isbn="1234567890" > > How to do this in couchdb? > I wouldn't want to create a temporary view for running each query as > it is very expensive. > > Thanks, > Anand >