PyMongo和toArray()方法

k_w*_*ski 4 python database document-oriented-db mongodb pymongo

我需要在一个小型数据库(64MB)上做一些基准测试,我需要弄清楚用PyMongo将整个Mongo集合提取到python对象的最聪明的方法是什么?在JavaScript中,有toArray()方法但我在python中找不到类似的东西.提前致谢!

Nat*_*Nat 13

你有没有尝试过?

result = list(db.collection.find())
Run Code Online (Sandbox Code Playgroud)