[SERVER-2861] MapReduce returns undefined _id Created: 29/Mar/11  Updated: 12/Jul/16  Resolved: 30/Mar/11

Status: Closed
Project: Core Server
Component/s: MapReduce
Affects Version/s: 1.8.0
Fix Version/s: 1.8.2, 1.9.0

Type: Bug Priority: Major - P3
Reporter: Kristina Chodorow (Inactive) Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-16713 mapReduce verify() failure with multi... Closed
Operating System: ALL
Participants:

 Description   

>> db.test.insert(

{x : 0}

)
>> var m = function()

{ emit(this.mod, this.x); }

>> var r = function(k,v) { total = 0; for(i in v)

{ total+= v[i]; }

return total; }
>> db.test.mapReduce(m, r,

{out : "test.out"}

)
{
"result" : "test.out",
"timeMillis" : 1,
"counts" :

{ "input" : 1, "emit" : 1, "output" : 1 }

,
"ok" : 1,
}

In the result, _id is undefined (it looks like null in the shell, but if you do a mongodump you can see it's type 6).

----------

This causes problems with replication (i.e., stops it completely).



 Comments   
Comment by auto [ 28/Apr/11 ]

Author:

{u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: fix m/r handling of undefined SERVER-2861
Branch: v1.8
https://github.com/mongodb/mongo/commit/4b5f2b33e8e7e858990bd4837f37c82290b7150d

Comment by auto [ 30/Mar/11 ]

Author:

{u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: fix m/r handling of undefined SERVER-2861
Branch: master
https://github.com/mongodb/mongo/commit/8cd20b51fd4defa44343decb235a5053d66381d6

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