Managing a Database Connection in an ExpressJS Application

A Web API or Web application backed by a database of some sort is a pretty typical application architecture regardless of what language or platform we might be looking at. So you can imagine my surprise that I haven’t really ever been able to find a satisfactory answer for how to best accomplish this kind of thing for an Express application that uses MongoDB. Maybe I either don’t know how to search very well, or maybe I just don’t really understand the answers that I’m finding, but the typical kind of answer that I’ve come across in the past reads something like this: