我正在关注调用map_reduce的示例,如下所示。
result = db.things.map_reduce(mapper, reducer, "myresults")
我收到以下错误:
AttributeError Traceback (most recent call last)
<ipython-input-112-c1ea3f3df4bb> in <module>()
----> 1 result = db.things.map_reduce(mapper, reducer, "myresults")
AttributeError: 'dict' object has no attribute 'map_reduce'
我做错了什么?
示例来自此处:http://api.mongodb.org/python/2.0/examples/map_reduce.html