I just the beginner of couchdb so I may be misunderstand point of view so you can teach and discuss with me
Doc Type - User - Topic - Comment
Requirement - I want to webboard - 1 Request to get this complex doc
Output I need KEY "topic-id" , VALUE { _id : "topic-id", created_at:"2011-05-30 19:50:22", title:"Hello World", user: {_id : "user-1",type:"user",username:"dominixz",signature:"http://dominixz.com"} comments: [ {_id:"comment-1", text:"Comment 1",created_at:"2011-05-30 19:50:22",user: {_id : "user-1",type:"user",username:"dominixz",signature:"http://dominixz.com"}}, {_id:"comment-2", text:"Comment 2",created_at:"2011-05-30 19:50:23",user: {_id : "user-2",type:"user",username:"dominixz2",signature:"http://dominixz1.com"}}, {_id:"comment-3", text:"Comment 3",created_at:"2011-05-30 19:50:24",user: {_id : "user-3",type:"user",username:"dominixz3",signature:"http://dominixz2.com"}}, ] }
I have "user" data like this {_id:"user-1",type:"user",username:"dominixz",signature:"http://dominixz.com"} {_id:"user-2",type:"user",username:"dominixz2",signature:"http://dominixz1.com"} {_id:"user-3",type:"user",username:"dominixz3",signature:"http://dominixz2.com"}
"Topic" data like this {_id : "topic-id",created_at:"2011-05-30 19:50:22",title:"Hello World",user:"user-1"}
"Comment" data like this {_id:"comment-1",type:"comment" , text:"Comment 1", created_at:"2011-05-30 19:50:22" , user: "user-1" , topic:"topic-id"} {_id:"comment-2",type:"comment" , text:"Comment 2", created_at:"2011-05-30 19:50:23" , user: "user-2" , topic:"topic-id"} {_id:"comment-3",type:"comment" , text:"Comment 3", created_at:"2011-05-30 19:50:24" , user: "user-3" , topic:"topic-id"}
How can I write map,reduce,list for achieve this complex data ? and how about when I wanna use LIMIT , OFFSET like in db
Thank in advance