Added support for replica sets to mongo