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

group() can't handle more than 20000 unique keys

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Environment:
      linux

      Description

      reducer = Code("""function(obj, prev){prev.count++;}""")
      keys = {'event':True,'type':True}
      conditions = {'event':'video_start'} 
      a = posts.group(key=keys,condition=conditions, initial={"count": 0}, reduce=reducer)
      for i in a:
          print i['type']
          keys = {'sn':True,'clip':True,'type':True}
          conditions = {'event':'video_play_blockend','type':i['type']}
          a = posts.group(key=keys,condition=conditions, initial={"count": 0}, reduce=reducer)
          for t in a:
              if t['count']>=3:
                  print t
          print 1-round(len(a)/i['count'],2),i['type']
          print len(a),i['count'],i['type']
      

      Traceback (most recent call last):
      File "read.py", line 24, in <module>
      a = posts.group(key=keys,condition=conditions, initial={"count": 0}, reduce=reducer)
      File "/usr/lib64/python2.6/site-packages/pymongo/collection.py", line 1941, in group
      collation=collation)["retval"]
      File "/usr/lib64/python2.6/site-packages/pymongo/collection.py", line 232, in _command
      collation=collation)
      File "/usr/lib64/python2.6/site-packages/pymongo/pool.py", line 419, in command
      collation=collation)
      File "/usr/lib64/python2.6/site-packages/pymongo/network.py", line 116, in command
      parse_write_concern_error=parse_write_concern_error)
      File "/usr/lib64/python2.6/site-packages/pymongo/helpers.py", line 210, in _check_command_response
      raise OperationFailure(msg % errmsg, code, response)
      pymongo.errors.OperationFailure: errmsg: "group() can't handle more than 20000 unique keys"
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kelsey.schubert Kelsey T Schubert
              Reporter:
              shenjiawei shenjiawei
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: