views:

292

answers:

1

How to create a complex map reduce function in couchdb to span a view over multiple documents with same attribute names to give back a single json object?

What is the most efficient way to manage this?

Is a nested set/source algorithm suitable for couchdb (changes are very write intensive)?

+1  A: 

If you want the whole documents you shouldn't use reduce. Just do a proper map function for the "type" attribute you talked about earlier and query the view with include_docs=true.

mikeal
Could you describe the include_docs=true property on a example?
haki
when you get back the view query it'll have another property next to "value" which is "doc" and that will be the whole document that was used to emit that key/value pair.
mikeal
it's a querystring paramater BTW :)
mikeal