7

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!

Community
  • 1
  • 1
k_wisniewski
  • 2,439
  • 3
  • 24
  • 31

1 Answers1

17

Have you tried?

result = list(db.collection.find())
Nat
  • 3,587
  • 20
  • 22