[SERVER-5588] mapReduce and eval not recognized by mongos Created: 12/Apr/12  Updated: 11/Jul/16  Resolved: 24/Oct/13

Status: Closed
Project: Core Server
Component/s: MapReduce, Sharding
Affects Version/s: 2.1.0
Fix Version/s: 2.5.4

Type: Bug Priority: Trivial - P5
Reporter: Randolph Tan Assignee: Siyuan Zhou
Resolution: Done Votes: 1
Labels: mongos, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-11217 The mapReduce command should accept n... Closed
is duplicated by SERVER-11003 discrepancy on mapReduce and mapreduc... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

The piece of code runs fine on mongod, but running on mongos would raise the exception:

error

{ "$err" : "unrecognized command: mapReduce", "code" : 13390 }

changing the command to use small caps mapreduce runs fine on both mongod and mongos.

db.bar.insert({ x: 1 });
var map = function() { emit( this.x, 1 ); };
var reduce = function( key, values ) { return 1; };
var mrResult = db.runCommand({ mapReduce: 'bar', map: map, reduce: reduce, out: { inline: 1 }});

Similarly, the following works on mongod but not mongos:

db.runCommand({eval: function () { print("noop"); } });



 Comments   
Comment by auto [ 24/Oct/13 ]

Author:

{u'username': u'visualzhou', u'name': u'Siyuan Zhou', u'email': u'siyuan.zhou@mongodb.com'}

Message: SERVER-5588 mapReduce and eval not recognized by mongos
Branch: master
https://github.com/mongodb/mongo/commit/6cfb561b21444b562df7f4e486b0cbd8de17ec42

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