[SERVER-2754] unwanted docs in mapreduce out collection Created: 14/Mar/11  Updated: 17/Mar/11  Resolved: 17/Mar/11

Status: Closed
Project: Core Server
Component/s: MapReduce
Affects Version/s: 1.8.0-rc2
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Everett Li Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Red Hat Enterprise Linux Server release 5.4 (Tikanga) x86_64


Attachments: Text File mongod.conf    
Operating System: Linux
Participants:

 Description   

There are some unwanted docs in output of mapreduce. After I switched to 1.6.5, the unwanted docs disappeared. For example,

rs1:PRIMARY> db.metering.find()
{ "_id" : ObjectId("4d7e389b9182b3d84087ca12"), "tenId" : "cdp", "subId" : "subt1", "userId" : "user1", "interval" : "2010-10-27-01", "policies" : { "default" :

{ "diskDelta" : 653, "umdDelta" : 34 }

}, "accessPaths" : { "rest" :

{ "bwIn" : 984, "bwOut" : 474, "txNum" : 6 }

} }
{ "_id" : ObjectId("4d7e38c49182b3d84087ca13"), "tenId" : "cdp", "subId" : "subt1", "userId" : "user2", "interval" : "2010-10-28-01", "policies" : { "policy1" :

{ "diskDelta" : 10, "umdDelta" : 10 }

}, "accessPaths" : { "rest" :

{ "bwIn" : 1, "bwOut" : 474, "txNum" : 6 }

} }
{ "_id" : ObjectId("4d7e3aa89182b3d84087ca14"), "tenId" : "cdp", "subId" : "subt1", "userId" : "user2", "interval" : "2010-10-29-01", "policies" : { "policy1" :

{ "diskDelta" : 20, "umdDelta" : 20 }

}, "accessPaths" : { "rest" :

{ "bwIn" : 1, "bwOut" : 474, "txNum" : 6 }

} }
rs1:PRIMARY> db.nnn.drop()
true
rs1:PRIMARY> m
function () {
emit(

{tenId:this.tenId, subId:this.subId, userId:this.userId, interval:"2011-03-14-00"}

,

{policies:this.policies}

);
}
rs1:PRIMARY> r
function () {
return

{du:0, umd:0}

;
}
rs1:PRIMARY> db.metering.mapReduce(m,r,

{ out : "nnn"}

);
{
"result" : "nnn",
"timeMillis" : 2,
"counts" :

{ "input" : 3, "emit" : 3, "output" : 2 }

,
"ok" : 1,
}
rs1:PRIMARY> db.nnn.find()
{ "_id" :

{ "tenId" : "cdp", "subId" : "subt1", "userId" : "user1", "interval" : "2011-03-14-00" }

, "value" : { "policies" : { "default" :

{ "diskDelta" : 653, "umdDelta" : 34 }

} } }
{ "_id" :

{ "tenId" : "cdp", "subId" : "subt1", "userId" : "user2", "interval" : "2011-03-14-00" }

, "value" :

{ "du" : 0, "umd" : 0 }

}
rs1:PRIMARY>



 Comments   
Comment by Everett Li [ 16/Mar/11 ]

It should be caused by different format of output of map and reduce function. Please close it. I apologize for that.

Generated at Thu Feb 08 03:01:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.