Functions are stateless, you cannot keep a connection open between function invocations.
That’s why I connect to mongo every time, also that’s why I didn’t use mongoose, the ODM, the problem with it is it compiles the model definitions every time and that is slow. You need DBs that can respond quick from connection, query and disconnect.