These are chat archives for Automattic/mongoose

23rd
Aug 2017
sagar789
@sagar789
Aug 23 2017 06:03
How can I use multiple dynamic DB with single code/project on run time with node.js
can anyone help me ?

I want to connect dynamic mongo DB with my single code according to sub domain url.
eg.
if www.xyz.example.com then mongo DB is xyz
if www.abc.example.com then mongo DB is abc
if www.efg.example.com then mongo DB is efg

if someone hit www.xyz.example.com url then xyz DB automatically connect. if someone hit www.abc.example.com url then abc DB automatically connect.

but xyz DB connection should not disconnect. it should be remain when another Db connect . Because there is single code/project.

Please give a solution and thanks in advance

Thanks sagar