MongoDB , , "" .
MapReduce MapReduce . #.
, , - , distinct :
{ "word": [ "some", "text"] }
:
dbCollection.Distinct("word");
, , , "",
,
MapReduce ... :
map = function() {
var splits = this.word.split(' ');
for(var i = 0, l = splits.length; i < l; i++) {
emit(splits[i], 1);
}
}
reduce = function(word, vals) {
var count = 0;
for(var i=0, l=vals.length; i < l; i++) {
count += vals[i];
}
return count;
}
MapReduce, .