Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-5588

mapReduce and eval not recognized by mongos

    • Fully Compatible
    • ALL

      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"); } });
      

            Assignee:
            siyuan.zhou@mongodb.com Siyuan Zhou
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: