Use setReadPreference() if setSlaveOkay() is not available (as in Mongo driver 1.4+)