Revision 643961363339 () - Diff

Link to this snippet: https://friendpaste.com/2nQ841lJ7O8aP4iPBeRPgc
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
example 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_error

Reduce 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)