I am trying to initialize a mongo Singleton connection with expressjs in the app/server.js file, in an async manner. I want to use the native driver and not Mongoose or something similar.

The whole internet is filled with bad patterns (IMHO) that open a new connection with each request.

Has anyone tried and succeeded in the former? Any link or advise will be appreciated.

For example

// app.js let client = await initMongoConnection()