cobrateam / flask-mongoalchemy

Flask support for MongoDB using MongoAlchemy.
https://pythonhosted.org/Flask-MongoAlchemy/
BSD 2-Clause "Simplified" License
217 stars 45 forks source link

Allowing MongoAlchemy to connect to a Replica Set instance. #35

Closed tresbailey closed 10 years ago

tresbailey commented 10 years ago

Uses the default pymongo connect method and keyword replicaSet. To use the replica set, its name must be passed into the config item, "MONGOALCHEMY_REPLICA_SET".

fsouza commented 10 years ago

Should the default value be None?

Thank you!

tresbailey commented 10 years ago

I got errors when passing in None to hit instances in a lower envirinment without replica sets. I will confirm the error and check on the pymongo documentation. Thanks for the quick response.

fsouza commented 10 years ago

Cool. No problem with the empty string, just checking :)

tresbailey commented 10 years ago

Confirmed that I receive an error when connecting with None as the default: TypeError: Wrong type for replicaSet, value must be an instance of basestring

In the pymongo docs, it looks like the replicaSet keyword requires a string value: http://api.mongodb.org/python/current/api/pymongo/connection.html

fsouza commented 10 years ago

Great, I will merge! :)