What is the Minimum and Maximum values of "reconnectTries" and "reconnectInterval" of MongoDB Node JS driver?

Hi, I have check the official document and source code of MongoDB Node JS driver. I observed that only default values of “reconnectTries=30” and "reconnectInterval=1000 "are given, but there is no minimum and maximum values for “reconnectTries” and “reconnectInterval” have provided.

Below are the reference link to official document and source code which I have referred:
1.Connection Settings
2. node-mongodb-native/pool.js at v3.6.12 · mongodb/node-mongodb-native · GitHub

Hi Gaurav,

Wanted to let you know that the docs in question are older docs. The newest docs for Mongo’s connection strings are here: https://www.mongodb.com/docs/manual/reference/connection-string/ Newer versions of the mongo drivers no longer need to configure their reconnect options. Instead, you specify per-command what your tolerance is to wait for a resolution. The initial connection is now captured under serverSelectionTimeoutMS for replica sets and connectTimeoutMS.

From a related JIRA ticket

We are radically dialing back what we consider to be an incomplete story for retryability in the driver, focusing first on providing first-class support for the specified retryable writes, and soon to be specified retryable reads. With the new SDAM layer there no longer is a required concept of “connecting”, rather you just create a client and begin to run operations, specifying how long you are willing to wait for a timeout and expecting the driver to automatically retry operations within that window.