[SERVER-250] server should support map/reduce operations Created: 23/Aug/09  Updated: 10/Sep/09  Resolved: 23/Aug/09

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Dwight Merriman Assignee: Eliot Horowitz (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

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



 Comments   
Comment by Eliot Horowitz (Inactive) [ 10/Sep/09 ]

closed b/c resolved more than 2 week ago

Comment by Eliot Horowitz (Inactive) [ 23/Aug/09 ]

dup of SERVER-208

Generated at Thu Feb 08 02:53:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.