mongodb/casbah — pull request #44 by troger (2012-01-03 23:13:39+00:00)
Title: Use DBObject as type for jsScope in MapReduceCommand

Hi,

I don't know if it's ok for backward compatibility but I find it more convenient to use `DBObject` for `jsScope` type as it should be an Object with each field added to the global scope.

Moreover when using `String`, it just does not work when setting the `jsScope` with:

...
jsScope = Some("{ testVar: true }")
...

When looking at the mongo logs, it produces the following:

scope: "{ testVar: true }"

instead of

scope: { testVar: true }

I've added a test to the MapReduceSpec.

Maybe it's better to try fixing the `jsScope` as `String` instead of using `DBObject`.

WDYT?