title: ReferenceError: Schema is not defined
body: <p>I'm trying to use an external schema with Mongoose in Node, but keep getting this error:</p>
  
  <blockquote>
    <p>ReferenceError: ContactSchema is not defined</p>
  </blockquote>
  
  <p>My ContactSchema.js looks like this:</p>
  
  <pre><code>var mongoose = require('mongoose');
  
  var Schema = mongoose.Schema;
  
  var ContactSchema = new Schema({
    name: String,
    address: String
  });
  
  module.exports = mongoose.model('ContactSchema', ContactSchema);
  </code></pre>
  
  <p>My routes.js file looks like this:</p>
  
  <pre><code>var mongoose = require('mongoose');
  mongoose.connect('mongodb://localhost/choredb');
  
  require('../models/ContactSchema.js');
  
  var routes = function(app) {
  
    app.post('/createnew', function(req, res) {
      console.log(req.body);
  
      var contact = new ContactSchema();
      contact.name = req.body.name;
      contact.note = req.body.note;
  
      contact.save(function(err){
        if (err) {throw err;}
        console.log('saved');
        mongoose.disconnect();
      });
    });
  
  }
  
  module.exports = routes;
  </code></pre>
  
  <p>I'm pretty sure it's not that far off, but can't figure out why it won't find the schema.</p>