title: Unable to set query filter in a mongodb mapReduce command
body: <p>I am trying to filter a mapReduce command with a query. This query seems to not beeing used by the mapReduce command. When I use the runCommand with the same parameters the query filter is used. I tryed with a mongodb 2.2.1 and a 2.0.1. </p>
  
  <p>The query of my mapReduce function is not used.</p>
  
  <pre><code>m = function () {
      if (this.duration &gt; 0) {
      emit("dur", this.duration);
    }
  }
  
  r = function (key, values) {
      var index = 0;
      var sum = 0;
      for (var i = 0; i &lt; values.length; i++) {
          sum += values[i];
          index++;
      }
      return sum / index;
  }
  </code></pre>
  
  <p>This command doesn't work :</p>
  
  <pre><code>res = db.movies.mapReduce(m,r, {out: { inline : 1}},{query:{kinds:'Action'}});
  
  {
      "results" : [
              {
                      "_id" : "dur",
                      "value" : 5148.227224559308
              }
      ],
      "timeMillis" : 1849,
      "counts" : {
              "input" : 105472,
              "emit" : 69602,
              "reduce" : 106,
              "output" : 1
      },
      "ok" : 1,
  }
  </code></pre>
  
  <p>This command work :</p>
  
  <pre><code>res = db.runCommand({mapReduce : "movies", map : m, reduce : r, query : {kinds:'Action'}, out : {inline:1} })
  
  {
      "results" : [
              {
                      "_id" : "dur",
                      "value" : 6134.118191572414
              }
      ],
      "timeMillis" : 238,
      "counts" : {
              "input" : 3577,
              "emit" : 2910,
              "reduce" : 4,
              "output" : 1
      },
      "ok" : 1
  }
  </code></pre>
  
  <p>With runCommand the query is used. Any ideas ?</p>