couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paweł Stawicki <>
Subject Re: How to make equivalent of WHERE on JOINed table in CouchDB?
Date Sat, 12 Dec 2009 22:31:01 GMT
> If I right understand your question:
> Look at git commit 926af4ba11093dcaff13bea0e4ed9addfc67ab10

I don't know how to look at this specific commit :(

> "include_docs now take an _id (as well as a _rev) in the emitted value, to
> load docs other than the one doing the emitting. This means you can have one
> doc list a
> set of other docs to load in a single query. Enjoy!"
> function(doc) {
>  if (doc.type == "Car") {
>    emit(doc.brand, null); // emits car document
>    emit(doc.brand, { _id: doc.person_id }); // emits whole person document
>  }
> }
> Then query your view using include_docs=true, key=Ferrari and you will get
> both Car and Person in a single query.

Maybe this is something wrong with my CouchDB implementation. I have
version 0.10.0, not the newest one, so it's a pity I can't look at
this commit. But when I did what you told me, I got just car document,
not person one:


Idea of having access in map function to other documents is great, I
hope I'll manage to get it working.

Best regards
Pawel Stawicki

View raw message