[CSHARP-967]  Can't canonicalize query Created: 09/May/14  Updated: 04/Apr/15  Resolved: 04/Apr/15

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.9
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Gustav Gahm Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

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?


Generated at Wed Feb 07 21:38:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.