I am using PyMongo and trying to iterate over (10 millions) documents in my MongoDB collection and just extract a couple of keys: \"name\" and \"address\", then output them to .
The find()
methods returns a PyMongo
cursor, which is a reference to the result set of a query.
You have to de-reference, somehow, the reference(address).
After that, you will get a better understanding how to manipulate/manage the cursor.
Try the following for a start:
result = db.*collection_name*.find()
print(list(result))