[SERVER-8632] System.js functions are not available to map/reduce jobs Created: 20/Feb/13 Updated: 11/Jul/16 Resolved: 27/Feb/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | MapReduce |
| Affects Version/s: | 2.4.0-rc0 |
| Fix Version/s: | 2.4.0-rc2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andre Quina | Assignee: | Ben Becker |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
OSX |
||
| Issue Links: |
|
||||||||||||
| Operating System: | ALL | ||||||||||||
| Steps To Reproduce: | In 2.4.0-rc0: > db.system.js.save({_id: "sum", value: function (x, y) { return x + y; }}); ) Wed Feb 20 10:21:53.844 map reduce failed:{ "errmsg" : "exception: map invoke failed: ReferenceError: sum is not defined _funcs1:1", "code" : 9014, "ok" : 0 } src/mongo/shell/collection.js:939 In 2.2.0: > db.system.js.save({_id: "sum", value: function (x, y) { return x + y; }}); > db.records.insert({foo:'bar'}) > db.records.mapReduce(function() { sum(1,2) } ,function() {}, {out: 'test_mr_out'}); , |
||||||||||||
| Participants: | |||||||||||||
| Description |
|
It does not appear that functions defined in system.js are available to map reduce jobs in 2.4.0-rc0. In 2.2.0 and before these functions were available. Without the ability to add functions to system.js for map reduce jobs, jobs with common functionality or that rely on JS libraries become unmanageable. Also, the full jobs must be sent to the server rather than simply calling a function defined in system.js |
| Comments |
| Comment by auto [ 27/Feb/13 ] |
|
Author: {u'date': u'2013-02-27T21:03:29Z', u'name': u'Ben Becker', u'email': u'ben.becker@10gen.com'}Message: |