In a nodeJS app, I'd want to connect to my MongoDB database via its UNIX socket /tmp/mongdb-27017.sock. I use the package https://mongodb.github.io/node-mongodb-native/?jmp=docs (version 3.1.6), this way:
const client = await MongoClient.connect("mongodb://%2Ftmp%2Fmongodb-27017.sock")
The URI is referenced in the doc here: https://docs.mongodb.com/manual/reference/connection-string/#unix-domain-socket. But in my case it fails with the error:
MongoNetworkError: failed to connect to server [/tmp/mongodb-27017.sock:27017] on first connect [MongoNetworkError: connect ECONNREFUSED /tmp/mongodb-27017.sock]
Do anyone know if it's possible to connect to a mongoDB UNIX socket from nodeJS, and if there's something specific to do? Couldn't find specific info in the doc.