MongoDB Next Example


Updated Apr 20th, 2022


Also checkout this article, directly from MongoDb on the best way to connect in NextJS including pooling.

“Additionally, within this file we cache the instance of our connection so that subsequent requests do not have to reconnect to the cluster. They can use the existing connection. All of this is handled for you!”