Alex Rivera | Logout

PyMongo and toArray() method

Asked 2012-01-04T07:50:15.573
8

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!

Edit
Report

1 Answer

19

Have you tried?

result = list(db.collection.find())
answered 2012-01-04T08:25:57.873

Your Answer