Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-967

Can't canonicalize query

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 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?

      Attachments

        Activity

          People

            Unassigned Unassigned
            gustav.gahm Gustav Gahm
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: