Closed tonymillion closed 12 years ago
This looks like a great idea. I just ran the tests and at first they failed. The exception "MongoCursorException: norepl" was thrown. Then I commented out your replica specific code and it worked fine.
It's in master now, minus your replica set specific stuff, though I would definitely like to see more support for replica sets.
In the future make sure you create a feature branch to create the pull request from.
Great, its my plan to sort out all the master/slave config stuff into a simple mongo:// connect string, and I'll include any replica set things in there.
This change uses findandmodify with returned object, so that the object in shanty matches the DB after Save()
currently if you call operations like inc() etc the object they are performed on becomes out of sync with the database after you call save(), often in a replica set you can't even read back the same object after a save as it may not have propagated to the other servers in the set.