Next.js Discord

Discord Forum

Mongoose connection function placement

Unanswered
Californian posted this in #help-forum
Open in Discord
CalifornianOP
I have a function called dbConnect which uses mongoose.connect(uri) method, where do i put this function so it runs once when I start the app, or should i use it every time in server actions and mongoose will manage it?

0 Replies