I want to know what the appearance of the last names in the collection is. I am using the following:
m = function() { this.lastname.forEach( function(z) { emit( z , { count : 1 } ); }); }; r = function(p, c) { var total = 0; for (var i =0; i < c.length; i++) total += c[i].count; return { count : total }; }; res = db.properties.mapReduce(m,r);
I get the following error:
uncaught exception: assert failed: options neededOrOutString
Any ideas?
source share