Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
1.9
-
None
-
None
-
Windows 8.1, Mongo 2.6.1
Description
I'm trying to run mapreduce on a collection using the C# driver (1.9.0) and a scope variable. I use the following code:
var map = @"function() {
|
emit(this._id, foo);
|
};";
|
|
|
var reduce = @"function(key, values) {
|
return values;
|
};";
|
|
|
var options = new MapReduceOptionsBuilder();
|
options.SetOutput(MapReduceOutput.Inline);
|
options.SetScope(new ScopeDocument("foo", "foo"));
|
When I use this code I get the following exception:
An exception of type 'MongoDB.Driver.MongoCommandException' occurred in MongoDB.Driver.dll but was not handled in user code
Additional information: Command 'mapreduce' failed: exception: Can't canonicalize query {} (response: { "errmsg" : "exception: Can't canonicalize query {}", "code" : 17238, "ok" : 0.0 })
If I remove the scope variable like below it works:
var map = @"function() {
|
//emit(this._id, foo);
|
emit(this._id, 1);
|
};";
|
|
|
var reduce = @"function(key, values) {
|
return values;
|
};";
|
|
|
var options = new MapReduceOptionsBuilder();
|
options.SetOutput(MapReduceOutput.Inline);
|
//options.SetScope(new ScopeDocument("foo", "foo"));
|
Does anyone know that's wrong?