In a sharded environment, the output of the "mapreduce" command is confusing.
Following is a map-reduce that generates a "tags" collection. That "tags" collection contains 5077 documents.
Problems:
#1: There is no indication of 5077 anywhere in that output.
#2: Based on the groups question, it looks like the output value from each shard may not be the last reduction for that node.
So the output value for a node may misrepresent that data that is actually on that node.
======
> db.runCommand(
);
{
"result" : "tags",
"shardCounts" : {
"localhost:6900" :
,
"localhost:6901" :
,
"localhost:6902" :
,
"localhost:6903" :
,
"localhost:6904" :
,
"localhost:6905" :
},
"counts" :
,
"ok" : 1,
"timeMillis" : 10978,
"timing" :
}
> db.tags.count()
5077
======
Associated groups question:
http://groups.google.com/group/mongodb-user/browse_thread/thread/65869b34e4230a3b#