In my previous post I mentioned a possible bug with MongoDb's MapReduce. Well, I played with it a bit further. I went ahead and added a string field to each document to hold the numeric Twitter post id as a string value. Then changed my map function to use this string value instead of the numeric id. This time the duplicate post query worked perfectly. It's results showed that there were no duplicate posts at all.

So, what is the problem? Is it a bug in MongoDb's MapReduce implementation? I doubt it. Is it a numeric bug with Javascript? Could be. Does my code suck? Totally possible. In looking at my MapReduce query that uses a long as part of the key, I cant see anything that would cause the false positive results. So my bet goes with a numeric issue in Javascript.