[SERVER-208] map reduce api Created: 03/Aug/09  Updated: 12/Jul/16  Resolved: 24/Sep/09

Status: Closed
Project: Core Server
Component/s: JavaScript, Usability
Affects Version/s: None
Fix Version/s: 1.1.1

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

Issue Links:
Depends
is depended on by SERVER-890 map/reduce Closed
Related
related to SERVER-257 Complex key support for group command Closed
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) [ 24/Sep/09 ]

simple map/reduce api
take a look at jstests/mr1.js

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

probably store in a temp collection. then you could even query it, etc....

Comment by Ryan Nitz [ 07/Aug/09 ]

How are large result datasets going to be handled? Will the results from the various nodes be stored in core or in a tmp document in the database? One of the issues (not sure if they fixed it yet) with GridGain is that the results from all the nodes is sent to a single node and placed in memory. I believe Hadoop handles this by storing all the node results in some sort of tmp file (and then provides a cursor).

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