命令是:
db.command({'convertToCapped': 'info', size:100000})
Traceback (most recent call last):
File "<pyshell#18>", line 1, in <module>
db.command({'convertToCapped': 'info', size:100000})
NameError: name 'size' is not defined
据我了解,您需要使用 pymongo 运行这样的命令:
db.command( "convertToCapped', 'info', size = 100000 );
如http://api.mongodb.org/python/current/api/pymongo/database.html#pymongo.database.Database.command所述