Database Connectivity
Unanswered
Pacific cod posted this in #help-forum
Pacific codOP
Where should the Database Connection reside in the app to be invoked Once the app starts, rather than creating multiple connection requests
In my case I'm using mongoose
In my case I'm using mongoose
1 Reply
Toyger
you can make singleton something like this https://stackoverflow.com/a/75273986
or this
https://medium.com/@technorahmon/building-a-robust-repository-layer-with-next-js-14-and-mongodb-a-comprehensive-guide-153de0b6b334
or this
https://medium.com/@technorahmon/building-a-robust-repository-layer-with-next-js-14-and-mongodb-a-comprehensive-guide-153de0b6b334