I am new to MongoDB, I am using map/reduce. Can somebody tell me how to debug while using map/reduce? I used "print()" function but on MongoDB shell, nothing is printed. Following is my reduce function:
var reduce = function(key, values){
var result = {count: 0, host: ""};
for(var i in values){
result.count++;
result.host = values[i].host;
print(key+" : "+values[i]);
}
return result;
}
when I write the above function on shell and the press Enter after completing, nothing gets printed on the shell. Is there anything else I should do to debug?
Thanks