Python Mongodb limiting by batch size times out <p>I'm trying to scrape a huge (5gb) mongo database, so I'm limiting the batch size in order to be manageable. However, I'm still getting a time out error :/</p> <p>My mongo knowledge is admittedly not the best, so if I'm doing something utterly stupid, please let me know! I already searched through the documentation and other questions and none of the answers have helped.</p> <p>Here is what I'm trying to do:</p> <pre><code>from pymongo import MongoClient collection = MongoClient(host="mongodb://xxx@xxx") cursor = collection.all_companies.companies batch = cursor.find().batch_size(1).limit(1) # I tried w/ other numbers too for item in batch: print item </code></pre> <p>And here's what I'm getting:</p> <blockquote> <p>pymongo.errors.ServerSelectionTimeoutError: xxx:xxx: timed out</p> </blockquote>