title: Mongoose and multiple database in single node.js project
body: <p>I'm doing a Node.js project that contains sub projects. One sub project will have one Mongodb database and Mongoose will be use for wrapping and querying db. But the problem is </p>
  
  <ul>
  <li>Mongoose doesn't allow to use multiple databases in single mongoose instance as the models are build on one connection.</li>
  <li><p>To use multiple mongoose instances, Node.js doesn't allow multiple module instances as it has caching system in <code>require()</code>. I know disable module caching in Node.js but I think it is not the good solution as it is only need for mongoose. </p>
  
  <p>I've tried to use <code>createConnection()</code> and <code>openSet()</code> in mongoose, but it was not the solution.</p>
  
  <p>I've tried to deep copy the mongoose instance (<a href="http://blog.imaginea.com/deep-copy-in-javascript/" rel="noreferrer">http://blog.imaginea.com/deep-copy-in-javascript/</a>) to pass new mongoose instances to the sub project, but it throwing <code>RangeError: Maximum call stack size exceeded</code>. </p></li>
  </ul>
  
  <p>I want to know is there anyways to use multiple database with mongoose or any workaround for this problem? Because I think mongoose is quite easy and fast. Or any other modules as recommendations?</p>