@@ -0,0 +1,1014 @@
+from DiscoJob import DiscoJob%0A%0A%0Aimport logging%0A%0Aconfig = %7B%0A        %22split_size%22: 1, #MB%0A        %22input_uri%22: %22mongodb://localhost/test.modforty%22,%0A        %22create_input_splits%22: True,%0A        %22split_key%22: %7B'_id' : 1%7D,%0A        %22output_uri%22:%22mongodb://localhost/test.out%22,%0A        #%22job_output_key%22:%22I am the key%22,%0A        %22job_output_value%22:%22I ame the value%22,%0A        %22job_wait%22:True%0A        %7D%0A%0Adef map(record, params):%0A    yield record.get('name', %22NoName%22), 1%0A%0Adef reduce(iter, params):%0A    from disco.util import kvgroup%0A    for word, counts in kvgroup(sorted(iter)):%0A        yield word, sum(counts)%0A%0Aif __name__ == '__main__':%0A%0A%0A    '''%0A    job = Job().run(%0A            #input=%5B%22mongodb://localhost/test.modforty%22%5D,%0A            input= do_split(config),%0A            map=map,%0A            reduce=reduce,%0A            map_input_stream = mongodb_input_stream,%0A            reduce_output_stream=mongodb_output_stream)%0A%0A    job.wait(show=True)%0A    '''%0A%0A    DiscoJob(config = config,map = map,reduce = reduce).run()%0A    %0A%0A

add a example