See my post in another thread. The fix is to use Promises instead of callbacks for MongoDB calls starting with Node 18 and Mongo 5.x
I can confirm this works and fixes the problem. I’m able to use latest Mongo 5.x client and Node 18.](Connecting Auth0 to MongoDB - #29 by dmitry)