title: (Node.js/Express.js) Error: Schema hasn't been registered for model "document"
body: <p>I was trying to work my way through the nodepad tutorial on Dailyjs.com (found <a href="http://dailyjs.com/2010/11/08/node-tutorial-2/" rel="noreferrer">here</a>). I eventually came to halt when I received this upon trying to execute(after step 2 of tut):</p>
  
  <pre><code>Error: Schema hasn't been registered for model "Document".
  Use Mongoose.define(name, schema)
      at Mongoose.model     (/usr/local/lib/node/.npm/mongoose/1.0.16/package/lib/mongoose/index.js:138:13)
      at Object.&lt;anonymous&gt; (/root/Repos/nodepad/models.js:3:10)
      at Module._compile (module.js:374:26)
      at Object..js (module.js:380:10)
      at Module.load (module.js:306:31)
      at Function._load (module.js:272:10)
      at require (module.js:318:19)
      at Object.&lt;anonymous&gt; (/root/Repos/nodepad/app.js:10:16)
      at Module._compile (module.js:374:26)
      at Object..js (module.js:380:10)
  </code></pre>
  
  <p>Mostly I'm a complete noob here, so what I really need is not so much a "do this to make it work" answer, but if you don't mind, an explanation as to what the actual cause of this error is.  I can post the actual code I have now if needed, and apologize if this is some agonizingly simple issue.</p>
  
  <p>models.js: </p>
  
  <pre><code>var mongoose = require('mongoose');
  
  mongoose.model('Document', {
      properties: ['title', 'data', 'tags'],
      indexes:    ['title']
  });
  
  exports.Document = function(db) {
      return db.model('Document');
  };
  </code></pre>