• Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.1.1
    • Affects Version/s: None
    • Component/s: JavaScript, Usability
    • Labels:
      None

      This is very similar to group() except group only allows a single key to be extracted per object; map would allow emitting several. And use the map / reduce nomenclature.

      Needs to work with mongos too.

      db.coll.mapreduce(queryexpr, mapf, reducef);

      db.stuff.mapreduce(
      {},
      function(obj) { obj.tags.forEach(function(t){emit(t,

      {count:1}

      );} },
      function(k,values) {
      var res =

      { count : 0 }

      ;
      values.forEach( function(v)

      { res.count += v.count; }

      );
      emit(k, res);
      }

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            eliot Eliot Horowitz (Inactive)
            Votes:
            8 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: