PyMongo and toArray() method

最后都变了- 提交于 2019-12-23 12:06:28

问题


I need to make some benchmarks on a small database (64MB) and I need to figure out what is the smartest way to fetch whole Mongo collection into python object with PyMongo? In JavaScript, there is toArray() method but I cannot find anything similar in python. Thanks in advance!


回答1:


Have you tried?

result = list(db.collection.find())


来源:https://stackoverflow.com/questions/8723613/pymongo-and-toarray-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!