Sign in
Log inSign up

How to handle Database connections in MONGO-GRAPHQL-MONGOOSE-NODE

Milton Akash's photo
Milton Akash
·Dec 3, 2017

I am developing an app using the above techs. I have a doubt about handling mongodb connections. Which one is the best

  1. Create Mongooose connection on beginnning and use it
  2. Create connection for each resolve and close it inside
  3. Or anything better