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

map reduce api

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 1.1.1
    • None
    • JavaScript, Usability
    • None

    Description

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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: