couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <robert.new...@gmail.com>
Subject Re: One-sided 1-to-many relationship
Date Wed, 15 Sep 2010 21:16:20 GMT
Does this help?

http://wiki.apache.org/couchdb/View_collation

B.

On Wed, Sep 15, 2010 at 10:10 PM, 7zark7 <7zark7@gmail.com> wrote:
> Given doc type A and B:
>
> A has a 1-to-many relationship with B (each A knows of many Bs)
> Each B can be known by many As, but does not know which.
> A has an array of its known B keys.
>
> A doc:
> {
>  "_id": "...",
>  "kind": "A",
>  "b_IDs": ["...", "...", "...", "..."]
> }
>
>
> B doc:
> {
>  "_id": "...",
>  "kind": "B"
> }
>
>
> If I know the key for A, how can I retrieve all related Bs in one view or
> list call?
> I'd like to avoid middle-ware that makes sequential calls.
>
> Thanks!
>

Mime
View raw message