example Revision 633136333139 (Mon Sep 13 2010 at 16:31) - Diff Link to this snippet: https://friendpaste.com/33QacbNL5nyGcARNN1TCdk Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455{_id: "AssemblyA",type: "Assembly"}Then you might also have:{_id: "ObjectA","type" : "part""what": "gadget",usedIn: [ "AssemblyA", "AssemblyB" ]}{_id:"ObjectB","what":"widget","usedIn": [ "AssemblyA", "AssembyC" ]}etc.and{_id:"toolA","type": "tool""what":"screwdriver","usedIn":[ "AssemblyA" ]}etc.Then, in your map function, (this is pseudocode, I didn't actually test it!)if (type == "Assembly") { emit ([doc._id,'assembly',nil],null); }if (type == "tool" || type == "part") { forEach (asm in doc.usedIn) { emit([asm,doc.type,0],null); }}That will get you['AssemblyA','assembly',nil]['AssemblyA','part',0]['AssemblyA','part',0]['AssemblyA','tool',0]If you do a query on startkey=['AssemblyA']&endkey['AssemblyA',{}]If you use "include_docs=true" - you will get the entire doc back when you query the view.