Mongodb shell, any parameter to terminate connection if can't conenct in x ms

mongodb shell, any parameter to terminate connection if can’t socket timeout in x ms

I connect mongodb using mongoshell with ldap, when ldap fail… mongo shell just stuck that for long time
and give the below message after some time (15 min!)
2022-03-29T20:55:27.900-0500 I NETWORK [js] DBClientConnection failed to receive message from xxxxx:27100 - SocketException: Connection timed out
2022-03-29T20:55:27.901-0500 E QUERY [js] Error: network error while attempting to run command ‘saslStart’ on host ‘xxxxxx’ :
connect@src/mongo/shell/mongo.js:341:17

I want to terminate mongoshell connection if it can’t connect for x second

Hello @soon_yu ,

If you are using mongoldap then you can refer this documentation for timeout settings (–ldapTimeoutMS=).

Thanks,
Tarun