A more performant way to iterate over a big (unindexed) MongoDB database, written in Python: