Details
Description
I get partial data from mongodb by using map/reduce api as well as by running the command in client tool. The command is like as below.
var m = function ()
{
emit(this.FundCode,
);
};
var r = function (key, emits)
{
var total =0;var items =[];
for (var i in emits)
{
total += emits[i].count;
items.push(
);
}
return
{count : total, itemCollection: items };
};
db.runCommand(
{ "mapreduce" : "ProfitEntity",
"map" : m,
"reduce": r,
"out" :
})
In theory, "count" equals the length of itemCollection. But it doesn't. The length of itemCollection is less. It is very strange. I have tested it by small data. The result is right. But by using big data it is wrong.