couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Friesen <>
Subject Re: equivalent of JOINs in couchdb?
Date Tue, 17 Mar 2009 07:04:23 GMT
Don't take my word completely for it, since I only started looking into 
CouchDB earlier on today.

But I think the issue is understanding the difference in thought process.

Rather than querying for data joining that data together, you index data 
with keys beforehand and use those keys to find the data.
For any of this kind of complex data, you create a view that emits keys 
using the relevant data.
So rather than a JOIN which finds all comments by post ids which are 
found by issue ids. You create a view which emits keys referring to the 
issue by tracking backwards to find the issue out from the post. Then 
you can just give it a issue id and it'll list out the comments.

~Daniel Friesen (Dantman, Nadir-Seen-Fire)

Anand Chitipothu wrote:
> Thanks. That was a good article.
> For my understanding, let me extend the same example to a magazine
> instead of blog.
> A magazine will have issues, each issue will have posts and post will
> have comments.
> I can use the technique described in the above blog post to display
> comments in each post.
> What if I want to display all comments of all posts of an issue?

View raw message