[SERVER-2272] Reducing M/R output into a new collection fails Created: 22/Dec/10  Updated: 12/Jul/16  Resolved: 16/Jan/11

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 1.7.4
Fix Version/s: 1.7.5

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

Mac OS X 64-bit


Operating System: OS X
Participants:

 Description   

When the "out" parameter of M/R is used to reduce the output into a collection that does not yet exist, a DB assertion error is thrown:

> db.data.mapReduce(m, r, { query:

{ serial: "BL0208109134", name: "interface-count-up" }

, finalize: f, out: { reduce: "reduce" }});
Wed Dec 22 10:58:08 uncaught exception: map reduce failed: {
"assertion" : "Not an index cursor",
"assertionCode" : 9011,
"errmsg" : "db assertion failure",
"ok" : 0
}

If you first create the collection by doing "out: 'reduce'", subsequent reduce operations will work as expected.



 Comments   
Comment by auto [ 16/Jan/11 ]

Author:

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

Message: some mr tests for SERVER-1787 SERVER-2272
https://github.com/mongodb/mongo/commit/ba78158d2f93394032daa2890e29777b29bf3192

Comment by auto [ 16/Jan/11 ]

Author:

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

Message: reduce to an empty collection works SERVER-2272
https://github.com/mongodb/mongo/commit/bbf5abc04abd59bf4f1b731cfddb0c4eca259852

Generated at Thu Feb 08 02:59:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.