After converting the standalone to the replica set the connection string has not been modified, but it works fine.
If I type mongo <server IP>
the connection string is still the same as it was before the conversion mongodb://mongodb0.example.com:27017/admin?compressors=disabled&gssapiServiceName=mongodb
.
How to convert it into mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/admin?replicaSet=myRepl&readPreference=primaryPreferred
?
I have tried to set read preferences with db.getMongo().setReadPref('primaryPreferred')
, but the string is still the same.
Thanks!