Skip to content

Commit 9623797

Browse files
author
Glynn Bird
committed
Added new reducers to the list of MapReduce reducers in the pull-down list
of the view editor. New items added: '_top_1', '_top_10', '_top_100', '_bottom_1', '_bottom_10', '_bottom_100', '_first', '_last' that is three example reducers for the _top_x & _bottom_x reducers, because they can take any number between 1 and 100, and that would be too many for this list. If users wanted to use _top_3, say, they would have to select the CUSTOM reducer and type _top_3 into the text field.
1 parent 30e335d commit 9623797

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/addons/documents/index-editor/reducers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Helpers from '../helpers';
1616

1717
const defaultMap = 'function (doc) {\n emit(doc._id, 1);\n}';
1818
const defaultReduce = 'function (keys, values, rereduce) {\n if (rereduce) {\n return sum(values);\n } else {\n return values.length;\n }\n}';
19-
const builtInReducers = ['_sum', '_count', '_stats', '_approx_count_distinct'];
19+
const builtInReducers = ['_sum', '_count', '_stats', '_approx_count_distinct', '_top_1', '_top_10', '_top_100', '_bottom_1', '_bottom_10', '_bottom_100', '_first', '_last'];
2020
const allReducers = builtInReducers.concat(['CUSTOM', 'NONE']);
2121

2222
const initialState = {

0 commit comments

Comments
 (0)