couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Coates <>
Subject Need to "subquery" in a view?
Date Fri, 25 Jun 2010 16:40:28 GMT
("subquery" for lack of a better term)
(Apologies if this is a duplicate message. I subscribed in the wrong order.)


I asked this in #CouchDB, but Jan suggested I also email it here.

I have a problem where I have data in couch, and I want to perform what seems like one too
many leaps of logic from within a view. Here's some sample data:

I want to query for a given id where type=user, and get all type=asset records owned by that
user, or by users that the queried user is following. Here are some examples that hopefully

_id=1; want documents with IDs: [4,5,6,7,8]
_id=2; want documents with IDs: [4,5,6]
_id=3; want documents with IDs: [4,5,7,8]
I hope that's clear enough. if not, please let me know, and I'll try to expand my explanation.

The foundation of the problem seems to be that from within a map, I can't fetch secondary
type=user documents in order to perform what amounts to a join (in SQL-speak).

Any help is appreciated. I'm currently solving this problem on the app side, but that's far
from ideal (causes a mess with things like limits, for example).


View raw message