Map/reduce with sorting fail

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 1.6.5
    • Component/s: Build
    • None
    • Environment:
      Ubuntu 10.10 2.6.35-23-generic #41-Ubuntu SMP Wed Nov 24 11:55:36 UTC 2010 x86_64 GNU/Linux
      python 2.6.6
      pymongo 1.9
    • Major Change
    • Linux
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      When i trying to make sort on map/reduce it fails with "db assertion failure"
      I wrote code in python, here it is:

      m = Code("""function() {
      data = {};
      res = ''
      if(this.result_id) {
      res=

      {'objectid':this.result_id.toString()}

      ;
      } else

      { res=this.result; }

      emit(this.data, res);
      }""")
      r = Code("""function(k,values) {
      data={};
      for(var i=0; i<values.length; i++ )

      { for(attr in values[i]) data[attr]=values[i][attr]; }

      return data
      }""")

      res = self.db.tasks.map_reduce(m,r,query=

      {'job_id':job_id}

      ,sort=

      {'position':pymongo.ASCENDING}

      )

      But when i turn off sorting it works pretty fine.

        1. map-reduce.py
          2 kB
          Andrey Nikishaev

            Assignee:
            Unassigned
            Reporter:
            Andrey Nikishaev
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: