You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
right now it seems like a connection to MongoDB is established when the Nuxt app starts. But when the app is deployed as a serverless function maybe a server handler is called that doesnt require any MongoDB connection. In this case the start of the app is delayed even tho MongoDB isnt even needed for the incoming request.
Is it possible to only connect to MongoDB when a query is executed?
For example:
GET api/cats -> returns data from a third party service -> No MongoDB connection is established
GET api/dogs -> calls model Dog.find() —> Now a MongoDB connection gets established
The text was updated successfully, but these errors were encountered:
I want to upvote this, it's something I just wanted to ask about 😀 Is there some way we could help with it? Do you have some idea how you would like to implement it?
Hello,
right now it seems like a connection to MongoDB is established when the Nuxt app starts. But when the app is deployed as a serverless function maybe a server handler is called that doesnt require any MongoDB connection. In this case the start of the app is delayed even tho MongoDB isnt even needed for the incoming request.
Is it possible to only connect to MongoDB when a query is executed?
For example:
The text was updated successfully, but these errors were encountered: