map/reduce fun delete lock Revision 643961363339 (Wed Nov 16 2011 at 05:44) - Diff Link to this snippet: https://friendpaste.com/2nQ841lJ7O8aP4iPBeRPgc Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 1234567891011121314151617181920212223242526272829303132333435example document: { "_id": "2286-1996-08-20", "_rev": "2-4aa5b6393c663ae3794efd67b9bbbd87", "title": "A title", "text": "This is an example", "tokens": [ "This", "is", "an", "example" ]}map:function(doc) { if ("tokens" in doc) { for (var i in doc.tokens) { emit(doc.tokens[i], doc._id); } }}reduce:function(keys, values) { var docs = []; for (var i = 0; i < values.length; ++i) { docs.push(values[i]); } return docs;}error msg:Error: reduce_overflow_errorReduce output must shrink more rapidly: Current output: '[["2650-1996-08-20","2650-1996-08-20","2650-1996-08-20","2650-1996-08-20","2650-1996-08-20","2650-19'... (first 100 of 849 bytes)