Question

I am using MongoDB 2.0.1 and facing a very strange problem. There are 3 mapreduce queries and I am firing mapreduce queries one by one. But the result of one mapreduce query seem to be going to another mapreduce query. It seems the session is getting maintained by mongodb. I am using Pylons as web framework, mongoengine as ORM wrapper and pymongo as python driver.

The three queries are like this -

map_f = 'function(){created_at=this.created_at.toUTCString().substr(0,16);emit(created_at,1);}'
reduce_f = 'function(key,vals) {return Array.sum(vals);}'
for result in xyz.objects().map_reduce(map_f,reduce_f):
    result_dict.update({result.key:result.value})

No correct solution

OTHER TIPS

Unless you're using the out argument to mapreduce, a mapreduce changes no data on the server side. MongoDB has no notion of a "session".

Can we see more of your code, and can you tell us the results you expect vs. your actual results?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top