My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How to handle Db connection in NODE?

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

I am doing an app using Node - Mongo - Graphql. So which is the best way to establish connections. Suppose if i make a db connection intially and if it fails in any case how can i reconnect it . Any other better way? Prons and cons of this method