title: Unable to start my nodejs application
body: <p>Hi I am trying to start a node-js based application but it is giving me some mongodb based error and I can't seem to start my plugin.</p>
  
  <p>Error:</p>
  
  <pre><code>/home/jira-Plugins/cloud/test-plugin/node_modules/mongodb/lib/server.js:110
    if(host.indexOf('\/') != -1) {
            ^
  TypeError: Cannot call method 'indexOf' of undefined
      at new Server (/home/jira-Plugins/cloud/test-plugin/node_modules/mongodb/lib/server.js:110:11)
      at new MongoDB (/home/jira-Plugins/cloud/test-plugin/node_modules/jugglingdb-mongodb/lib/mongodb.js:51:18)
      at Object.initializeSchema [as initialize] (/home/jira-Plugins/cloud/test-plugin/node_modules/jugglingdb-mongodb/lib/mongodb.js:26:22)
      at new Schema (/home/jira-Plugins/cloud/test-plugin/node_modules/jugglingdb/lib/schema.js:106:13)
      at Object.&lt;anonymous&gt; (/home/jira-Plugins/cloud/test-plugin/app.js:56:14)
      at Module._compile (module.js:456:26)
      at Object.Module._extensions..js (module.js:474:10)
      at Module.load (module.js:356:32)
      at Function.Module._load (module.js:312:12)
      at Function.Module.runMain (module.js:497:10)
      at startup (node.js:119:16)
      at node.js:902:3
  </code></pre>
  
  <p>Here are the configurations I am currently using:
  database.js</p>
  
  <pre><code>module.exports = {
      url : 'mongodb://localhost/test'
  };
  </code></pre>
  
  <p>app.js:</p>
  
  <pre><code>var mongoose = require('mongoose');
  
  /*var methodOverride = require('method-override'); // simulate DELETE and PUT (express4)*/
  var database = require('./config/database');
  /*var port     = process.env.PORT || 8888;*/         // set the port
  
  mongoose.connect(database.url);
  console.log('Connected to Database: ' + database.url);
  
  var Schema = require('jugglingdb').Schema;
  var schema = new Schema('mongodb');
  
  var schema = new Schema('mongodb', {
    url: 'mongodb://localhost/test',
  });
  </code></pre>
  
  <p>I am also using jugglingdb as crossDb ORM in my application</p>
  
  <p>config.json </p>
  
  <pre><code>"store": {
    "adapter": "jugglingdb",
    "type": "mongodb"
  
  },
  </code></pre>
  
  <p>After I implemented the suggestions provided the errors has completely changed:</p>
  
  <pre><code>Unhandled error: TypeError: Cannot call 
  
      method 'indexOf' of undefined
          at new Server (/home/jira-Plugins/cloud/test-plugin/node_modules/mongodb/lib/server.js:110:11)
          at new MongoDB (/home/jira-Plugins/cloud/test-plugin/node_modules/jugglingdb-mongodb/lib/mongodb.js:51:18)
          at Object.initializeSchema [as initialize] (/home/jira-Plugins/cloud/test-plugin/node_modules/jugglingdb-mongodb/lib/mongodb.js:26:22)
          at new Schema (/home/jira-Plugins/cloud/test-plugin/node_modules/atlassian-connect-express/node_modules/jugglingdb/lib/schema.js:105:13)
          at /home/jira-Plugins/cloud/test-plugin/node_modules/atlassian-connect-express/lib/store/jugglingdb.js:34:32
          at lib$rsvp$$internal$$initializePromise (/home/jira-Plugins/cloud/test-plugin/node_modules/atlassian-connect-express/node_modules/rsvp/dist/rsvp.js:541:9)
          at new lib$rsvp$promise$$Promise (/home/jira-Plugins/cloud/test-plugin/node_modules/atlassian-connect-express/node_modules/rsvp/dist/rsvp.js:757:9)
          at new JugglingDB (/home/jira-Plugins/cloud/test-plugin/node_modules/atlassian-connect-express/lib/store/jugglingdb.js:32:18)
          at module.exports (/home/jira-Plugins/cloud/test-plugin/node_modules/atlassian-connect-express/lib/store/jugglingdb.js:168:10)
          at Function.stores.create (/home/jira-Plugins/cloud/test-plugin/node_modules/atlassian-connect-express/lib/store/index.js:18:10)
          at stores (/home/jira-Plugins/cloud/test-plugin/node_modules/atlassian-connect-express/lib/store/index.js:12:17)
          at EventEmitter.Addon (/home/jira-Plugins/cloud/test-plugin/node_modules/atlassian-connect-express/lib/index.js:31:38)
          at module.exports (/home/jira-Plugins/cloud/test-plugin/node_modules/atlassian-connect-express/lib/index.js:204:12)
          at Object.&lt;anonymous&gt; (/home/jira-Plugins/cloud/test-plugin/app.js:32:13)
          at Module._compile (module.js:456:26)
          at Object.Module._extensions..js (module.js:474:10)
      Unhandled error: TypeError: Cannot read property 'settings' of undefined
          at JugglingDB.proto.isMemoryStore (/home/jira-Plugins/cloud/test-plugin/node_modules/atlassian-connect-express/lib/store/jugglingdb.js:78:29)
          at EventEmitter.exports.shouldRegister (/home/jira-Plugins/cloud/test-plugin/node_modules/atlassian-connect-express/lib/internal/registration.js:45:67)
          at /home/jira-Plugins/cloud/test-plugin/node_modules/atlassian-connect-express/lib/internal/registration.js:85:54
          at lib$rsvp$$internal$$tryCatch (/home/jira-Plugins/cloud/test-plugin/node_modules/atlassian-connect-express/node_modules/rsvp/dist/rsvp.js:493:16)
          at lib$rsvp$$internal$$invokeCallback (/home/jira-Plugins/cloud/test-plugin/node_modules/atlassian-connect-express/node_modules/rsvp/dist/rsvp.js:505:17)
          at /home/jira-Plugins/cloud/test-plugin/node_modules/atlassian-connect-express/node_modules/rsvp/dist/rsvp.js:1001:13
          at Object.lib$rsvp$asap$$flush [as _onImmediate] (/home/jira-Plugins/cloud/test-plugin/node_modules/atlassian-connect-express/node_modules/rsvp/dist/rsvp.js:1198:9)
          at processImmediate [as _immediateCallback] (timers.js:330:15)
  </code></pre>