I'm writing a map reduce in MongoDB to remove duplicates words from the stuff
array:
reduce = function(key, stuff){
var x = stuff.toString();
var z = Array.from( new Set(x.split(','))).toString();
return z
};
MongoDB gets an error:
MR processing failed: { errmsg: \"exception: ReferenceError: Set is not defined\n at _funcs2 (_funcs2:1:84) near 'from( new Set(x.split(',')).toString()); ' \", code: 16722, ok: 0.0 }"}
I'm using MongoDB 3.0.9.