The exception stack:
morphia model code caused the trouble:
morphia model code that will not cause the trouble:
Root cause: Not found
The exception stack:
morphia model code caused the trouble:
morphia model code that will not cause the trouble:
Root cause: Not found
// the map function var map = function() { var dimension = this[dimension] ? this[dimension] : "_"; var key = this.inst + "|" + this.bar + "|" + dimension; var result = {hit: 1}; emit(key, result); }; // the statement to call mapreduce db.foo.mapReduce(map, reduce, { out: {inline: 1}, query: q, scope: {dimension: "red"}});
dimension
is redefined in the map function. Change the map funciton to the following solves the problem:
// the map function var map = function() { var d= this[dimension] ? this[dimension] : "_"; // changed var key = this.inst + "|" + this.bar + "|" + d; // changed var result = {hit: 1}; emit(key, result); };