tmountain
unread,Jul 18, 2012, 11:03:03 AM7/18/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongod...@googlegroups.com
Hi guys, trying to do a basic map reduce job and running into a snag. I've tried a few basic tests, and it seems like my reduce job is always ignored. Here's an example:
> var m = function() { emit( this.s, {count : 10} ) } // this.s is a session id
> var r = function(key, values) { return {count : 20}; }
> db.tracking.mapReduce(m, r, "foo")
{
"result" : "foo",
"timeMillis" : 36,
"counts" : {
"input" : 52,
"emit" : 52,
"reduce" : 0,
"output" : 52
},
"ok" : 1,
}
> db.foo.find()
{ "_id" : "201207_01202097a09378b506fa529bd946f356", "value" : { "count" : 10 } }
{ "_id" : "201207_01b56eac4ff502bd7da53bfab8a4ea98", "value" : { "count" : 10 } }
As you can see, all I'm trying to do here is change the value of count, but for some reason the original value is being reported.