0
我試圖在執行如「http://api.mongodb.org/python/1.3/examples/map_reduce.html",I得到了以下錯誤:pymongo mapreduce示例中的錯誤?
File "map_red.py", line 30, in
if name == 'main': main()
File "map_red.py", line 24, in main
result = db.things.map_reduce(map, reduce)
TypeError: map_reduce() takes at least 4 arguments (3 given)
所以我編輯的代碼看起來是這樣,但我沒有看到任何輸出(I也改爲「結果」與「mr_result」中找到(),但仍沒有輸出!)
result = db.things.map_reduce(map, reduce,{"out": "mr_results"})
result_find = db.result.find()
for doc in result_find:
print doc