0

I need to perform some aggregation on one existing table and then use aggregated table to perform the map reduce.

The aggregation table is sort of a temporary used so that it can be used in map reduce. Record set in temporary table reaches around 8M.

What can be the way to avoid the temporary table?

One way could be to write find() query inside map() function and emit the aggregated result(initially being stored on aggregation table).

However, I am not able to implement this. Is there a way! Please help.

Charanjeet Kaur
  • 1,199
  • 3
  • 14
  • 27
  • I highly doubt that it is a good idea to use find inside the map. What is the problem with storing the output of the aggregation framework in another collection and then use that collection to do mapreduce on it. You can look [here how to achieve it](http://stackoverflow.com/q/13612028/1090562) – Salvador Dali Nov 26 '13 at 21:04

1 Answers1

0

You can use the "query" parameter on MongoDB MapReduce. With this parameter the data sent to map function is filtered before processing.

More info on MapReduce documentation

rubenfa
  • 831
  • 1
  • 7
  • 23