mongodb/mongo-python-driver — pull request #186 by heewa (2013-05-25 20:06:12+00:00)
Title: Add generator versions of decode_all in bson module.

When decoding large collections of bson documents, the python representation
of dicts are time and space costly, so it's sometimes useful to generate and
consume the documents iteratively. This patch adds two new functions to do
that: decode_iter and decode_file_iter. The first is given all the bson data,
but yields one document at a time, while the second reads from a file object
enough to yield one document at a time (to avoid reading in an entire file).