title: MongoDB reduce functions is not running
body: <p>I've translated the follow sql statment to map reduce:</p>
  
  <pre><code>select
      p_brand,    p_type,     p_size, 
      count(ps_suppkey) as supplier_cnt
  from 
      partsupp, part
  where 
      p_partkey = ps_partkey
      and p_brand &lt;&gt; 'Brand#45'
      and p_type not like 'MEDIUM POLISHED %'
      and p_size in (49, 14, 23, 45, 19, 3, 36, 9)
      and ps_suppkey not in (
              select 
              s_suppkey
              from 
              supplier
              where 
              s_comment like '%Customer%Complaints%'
          )
  group by 
      p_brand, p_type, p_size
  order by 
      supplier_cnt desc, p_brand, p_type, p_size;
  </code></pre>
  
  <p>Map reduce function:</p>
  
  <pre><code>db.runCommand({
      mapreduce: "partsupp",
      query: {
          "ps_partkey.p_size": { $in: [49, 14, 23, 45, 19, 3, 36, 9] },
          "ps_partkey.p_brand": { $ne: "Brand#45" }
      },
      map: function() {
          var pattern1 = /^MEDIUM POLISHED .*/;
          var pattern2 = /.*Customer.*Complaints.*/;
  
          var suppkey = this.ps_suppkey.s_suppkey;
  
          if( this.ps_suppkey.s_comment.match(pattern1) == null ){
              if(this.ps_suppkey.s_comment.match(pattern2) != null){
                  emit({p_brand: this.ps_partkey.p_brand, p_type: this.ps_partkey.p_type, p_size: this.ps_partkey.p_size}, suppkey);
              }
          }
      },
      reduce: function(key, values) {
          return values.length;
      },
      out: 'query016'
  });
  </code></pre>
  
  <p>The output result (seems to me) has no one reduce:</p>
  
  <pre><code>{
          "result" : "query016",
          "timeMillis" : 46862,
          "counts" : {
                  "input" : 122272,
                  "emit" : 54,
                  "reduce" : 0,
                  "output" : 54
          },
          "ok" : 1
  }
  </code></pre>
  
  <p>Whats wrong?</p>