couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Groves <adam.gro...@gmail.com>
Subject Re: equivalent of JOINs in couchdb?
Date Fri, 13 Mar 2009 12:36:27 GMT
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 <anandology@gmail.com>:
> 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
>

Mime
View raw message