mapReduce no output into result
Answered
hello, how do I get a result in the window when using the function mapReduce?
MySample : I have no output
var mapFunc = () => {
emit(this.Name, 1);
};
var reduceFunc = (key, values) => {
return Array.sum(values);
};
db.MyCollection.mapReduce( mapFunc, reduceFunc,{out: { "inline":1 }});
thx
The same question
Please modify your code as follows and try it again.
var mapFunc =function() { //Arrow functions are anonymous and change the way this binds in functions. emit(this.Name, 1); }; var reduceFunc = function(key, values) { return Array.sum(values); }; db.MyCollection.mapReduce( mapFunc, reduceFunc,{out: { "inline":1 }});Please modify your code as follows and try it again.
var mapFunc =function() { //Arrow functions are anonymous and change the way this binds in functions. emit(this.Name, 1); }; var reduceFunc = function(key, values) { return Array.sum(values); }; db.MyCollection.mapReduce( mapFunc, reduceFunc,{out: { "inline":1 }});Please modify your code as follows and try it again.
var mapFunc =function() { //Arrow functions are anonymous and change the way this binds in functions. emit(this.Name, 1); }; var reduceFunc = function(key, values) { return Array.sum(values); }; db.MyCollection.mapReduce( mapFunc, reduceFunc,{out: { "inline":1 }});Please modify your code as follows and try it again.
var mapFunc =function() { //Arrow functions are anonymous and change the way this binds in functions. emit(this.Name, 1); }; var reduceFunc = function(key, values) { return Array.sum(values); }; db.MyCollection.mapReduce( mapFunc, reduceFunc,{out: { "inline":1 }});perfect it works, thank you
perfect it works, thank you
Replies have been locked on this page!