Details
-
Task
-
Resolution: Done
-
Major - P3
-
None
-
legacy-1.0.0
-
None
-
Linux version 2.6.32-504.3.3.el6.x86_64 (mockbuild@x86-028.build.eng.bos.redhat.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-9) (GCC) ) #1 SMP Fri Dec 12 16:05:43 EST 2014
Description
If I use DBClientConnection () API to make mongodb connection, I can specify _autoReconnect to be true which allow automatic reconnect on a connection failure.
However, I am using following API to connect (recommended way?):
=====================================================
std::string errString;
mongo::ConnectionString mongoConnectionString = mongo::ConnectionString::parse(hostAndPortStr_, errString);
...
mongoPtr_ = mongoConnectionString.connect(errString);
if (!mongoPtr_->auth(mongodbDatabase_, mongodbUsername_, mongodbPassword_, errString))
;
============================================
I don't see a way to set auto_reconnect to true using this API.
Is auto_reconnect true or false in this case?
If it is false, how do I set it to true?
Thanks in advance!