incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paweł Stawicki <pawelstawi...@gmail.com>
Subject How to make equivalent of WHERE on JOINed table in CouchDB?
Date Sat, 12 Dec 2009 20:38:49 GMT
Crossposting from stackoverflow.com.

Assume we have two kind of documents in CouchDB. Person and Car:

Person:
_id
firstname
surname
position
salary

Car:
_id
person_id
reg_number
brand
So there is one to many relationship. One person can have many cars.

I can construct map function to get every person and his/her car next
to each other. In such case key is array [person.id, 0] and
[car.person_id, 1].

What I can't do, is limiting this view to owners of specific brand
only, e.g. if I need salaries of owners of Ferrari. So set of
documents (persons) is limited by related documents (cars). How can I
do it?

Best regards
--
Paweł Stawicki
http://pawelstawicki.blogspot.com
http://szczecin.jug.pl
http://www.java4people.com

Mime
View raw message