Can't canonicalize query

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 1.9
    • Component/s: None
    • None
    • Environment:
      Windows 8.1, Mongo 2.6.1
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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?

            Assignee:
            Unassigned
            Reporter:
            Gustav Gahm
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: