I'm using mongodb database in node.js with mongodb module. I want to know how to use one mongodb instance into different-different module?
I create a instance of mongodb database inside app.js. And for routing I used another module myroutes.js and I want to re-use the same mongodb instance (which I already created in app.js) inside myroutes.js.
How I do this? I tried it using app.set() but it doesn't work.