PyMongo:无法在dict对象上调用map_reduce

时间:2015-01-29 02:25:22

标签: python mongodb pymongo

我正在关注调用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

0 个答案:

没有答案