title: How to use mongoose object in another node file?
body: <p>I am new to node.js . I am trying to create one connection in server.js and use it in addAcction.js but got error while running "Software is not
      a constructor", Please help me this?</p>
  
  <pre><code>   //Server .js
      var mongoose = require('mongoose');
      mongoose.connect('mongodb://localhost:27017/MSDN');
      var db = mongoose.connection;
      db.on('error', console.error.bind(console, 'connection error'));
      db.once('open', function callback() {
        console.log("Connection with database succeeded.");
      });
      module.exports = db;
      var SoftwareSchema   = new mongoose.Schema({
            SoftwareID: Number,
            SoftwareName: String,
          });
      module.exports = mongoose.model('Software', SoftwareSchema);
  
     //addAction.js
  
      var Software = require('./Server').Software;
      var Software1 = new Software({
      SoftwareID   : 1,
      SoftwareName : "MNG123",  
      });
      Software1.save(function(err){
         if ( err ) throw err;
         console.log("Software Saved Successfully");
     });
  </code></pre>