My aim is to create a map function like this
map = function () { var key = {key:this.name-1}; emit(key, {count:1}); }
I pass the parameter “name-1” in a java code. But mongo takes it as “name minus 1”. So key becomes and integer and so during map reduce I get NaN problem.
The map actually looks like this
map = function () { var key = {key:this.name - 1}; emit(key, {count:1}); }
how to overcome this problem?
Phew finally this works.