mapReduce and eval not recognized by mongos

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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
              Reporter:
              Randolph Tan
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: