MongoServerSelectionError with Node client and local installation on Ubuntu 20.04

I’m trying to connect to a local instance of MongoDB 6.0.6 (no replica set) via the MongoDB Node client. I’m getting the following error:

  "message":"connection timed out",
  "stack":"MongoServerSelectionError: connection timed out
    \n    at Timeout._onTimeout (…/node_modules/mongodb/src/sdam/topology.ts:567:30)
    \n    at listOnTimeout (node:internal/timers:569:17)
    \n    at processTimers (node:internal/timers:512:7)"
"msg":"connection timed out","time":"2023-07-06T16:23:22.142Z",

the corresponding MongoDB log output is:

"msg":"Connection accepted","attr":{"remote":"","uuid":"0bc27e00-4dcc-4b3d-98d9-5fd4b8f58128","connectionId":8,"connectionCount":2}}
"s":"I",  "c":"NETWORK",
"msg":"Connection ended","attr":{"remote":"","uuid":"0bc27e00-4dcc-4b3d-98d9-5fd4b8f58128","connectionId":8,"connectionCount":1}}

I’m using the following config for the MongoDB isntance:

  ipv6: true
  bindIp: ''
  port: 27017
    enabled: true
  authorization: 'disabled'

and the node client options are:
new MongoClient('mongodb://', { directConnection: true })

Hey @Sebastian_Luksic,

Thank you for reaching out to the MongoDB Community forums.

I suspect the format of the configuration file is not correct, as the bindIp does not need to be enclosed in single quotes ''. I recommend referring to the Configuration Options in the MongoDB docs to learn more about it.

Best regards,