Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-2269

Map/reduce with sorting fail

    XMLWordPrintableJSON

Details

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

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: