data = [{uid: 1 , event: 'a' , time: 1} , {uid: 1 , event: 'b' , time: 2} , {uid: 2 , event: 'c' , time: 2} , {uid: 3 , event: 'd' , time: 4} ] { {uid: 1} : [{uid: 1 , event: 'a' , time: 1} , {uid: 1 , event: 'b' , time: 2} ], {uid: 2} : [{uid: 2 , event: 'c' , time: 2} ], {uid: 3} : [{uid: 3 , event: 'd' , time: 4} ] } You needn't use the reduce function to actually reduce anything >>> coll.insert(dict(uid=1,event='a',time=1)) ObjectId('4d5b91d558839f06a8000000') >>> coll.insert(dict(uid=1,event='b',time=2)) ObjectId('4d5b91e558839f06a8000001') >>> coll.insert(dict(uid=2,event='c',time=2)) ObjectId('4d5b91f358839f06a8000002') >>> coll.insert(dict(uid=3,event='d',time=4)) ObjectId('4d5b91fd58839f06a8000003') >>> result = coll.group(['uid'], None,{'list': []}, 'function(obj, prev) {prev.list.push(obj)}') >>> len(result) # will show three groups 3 >>> int(result[0]['uid']) 1 >>> result[0]['list'] [{u'event': u'a', u'_id': ObjectId('4d5b...0000'), u'uid': 1, u'time': 1}, {u'event': u'b', u'_id': ObjectId('4d5b...0001'), u'uid': 1, u'time': 2}] >>> int(result[1]['uid']) 2 >>> result[1]['list'] [{u'event': u'c', u'_id': ObjectId('4d5b...0002'), u'uid': 2, u'time': 2}] >>> int(result[2]['uid']) 3 >>> result[2]['list'] [{u'event': u'd', u'_id': ObjectId('4d5b...0003'), u'uid': 3, u'time': 4}]