slacy/minimongo — pull request #31 by YoavShapira (2013-01-09 17:52:53+00:00)
Title: Support MongoDB replica set connections / clients

This pull requests modifies options.py and model.py so that they support connecting to a MongoDB replicaset using the high-availability MongoReplicaSetClient.

Documentation for this client is available at http://api.mongodb.org/python/current/examples/high_availability.html.

This pull request updates the minimum required version of PyMongo from 1.9 to 2.4 on purpose, which is also done in the one other open pull request. This is needed not just for the high-availability client but also for MongoDB 2.2+ itself.

When replica sets are not configured, the behavior is the same as before, except it uses the current MongoClient instead of the old, deprecated Connection class.

While I was in there, I added a bit of DEBUG-level logging.