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

server should support map/reduce operations

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • 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)
            dwight@mongodb.com Dwight Merriman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: