PyMongo and toArray() method
Asked Answered
S

1

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!

Strath answered 4/1, 2012 at 7:50 Comment(0)
O
19

Have you tried?

result = list(db.collection.find())
Osanna answered 4/1, 2012 at 8:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.