Memorize.com

Couchdb Map-Reduce

edit

Summary

Memorize core concepts of how couchdb implements map-reduce.

Basic

Question (memorize) Answer (memorize)
function that returns output from viewemit()
emit() parameterskey, value
views must be...referentially transparent
reduce function must be...referentially transparent, and able to reduce on it's own output (and get the same answer)
referentially transparentgiven same input, always gives same output

Advanced

Question (memorize) Answer (memorize)
reduce() params (in general)keys, values, rereduce
rereduce parameterwhether input comes from another call to reduce() (boolean)
reduce() params (when rereduce false)[[key,id]...], [value...], false
reduce() params (when rereduce true)null, [reduced...], true
groups of roughly __ are passed into reduce()15
output flows from _____ to _____ to _____map, reduce(...,false), reduce(...,true)
reduce() outputs...whatever structure it wants