mongo
mongo copied to clipboard
feat: Automatic reconnect
Many mongodb drivers implement a reconnect for when a connection to remote server is dropped. This is needed for any long standing use, like on servers to recover from any loss of connectivity or db server reboot. On desktop the connection is lost when device goes to sleep, also calling for a reconnect.
At the moment I guess we can and should wrap all mongodb calls in try/catch in user code, and manually attempt to reconnect as needed. But this is somewhat nontrivial problem many end users of the driver may struggle with. Having this functionality built in the driver would be a nice feature.