Created
March 3, 2015 07:19
-
-
Save swayson/3bd98a1707ecb5992362 to your computer and use it in GitHub Desktop.
MongoDB Find generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pymongo.connection import Connection | |
m = Connection() | |
db = m.reddit | |
votes = db.votes | |
cursor = votes.find().skip(0).limit(50000) | |
print "Setup cursor: %s" % cursor | |
def iter(): | |
for item in cursor: | |
yield item | |
for x in iter(): | |
print x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment