title: Mongoose throws error on second time with Schema hasn't been registered
body: <p>I have a schema design where users submit language translation requests. A translation request document has reference to user documents and properties are called "_requester" and "_translator". I want to be able to populate these upon performing some query on translation request collection. Problem happens when I do a certain query, populate the _translator and results look perfect. Then if I do the exact same query it fails second time with the error message saying <strong>Schema hasn't been registered for model "User".</strong></p>
  
  <p>Here is how this has been coded in my code. There are two files. One js file where the mongoose sits and another js file that uses it via the model some what like dependency injection.</p>
  
  <p><strong>(mongoose-util.js)</strong></p>
  
  <pre><code>function MongooseUtil(){
      var mongoose = require('mongoose');
      var mongoosePaginate = require('mongoose-paginate');
      var Schema = {
          User: {
              userId: String,
              password: String,
              nickName: String,
              state: String,
              emailVerificationCode: String,
              avatarUrl: String,
              points: Number
          },
          TranslationRequest: {
              _requester: { type: mongoose.Schema.ObjectId, ref: "User" },
              _translator: { type: mongoose.Schema.ObjectId, ref: "User" },
              to: String,
              from: String,
              textToTranslate: String,
              translatedText: String,
              state: String,
              requestedTime: Number,
              translatedTime: Number,
              gradedTime: Number,
              grade: Number,
              requesterUserId: String,
              translatorUserId: String,
              graderUserId: String
          }
      };
  
      // user
      var userSchema = mongoose.Schema(Schema.User);
      var userModel = mongoose.model('User', userSchema);
  
      // translation request
      var translationRequestSchema = mongoose.Schema(Schema.TranslationRequest);
      translationRequestSchema.plugin(mongoosePaginate);
      var translationRequestModel = mongoose.model('TranslationRequest', translationRequestSchema);
  
      this.getUserModel = function(){
          return userModel;
      }
  
      this.getTranslationRequestModel = function(){
          return translationRequestModel;
      }
  }
  
  module.exports = new MongooseUtil();
  </code></pre>
  
  <p><strong>(translation-request-service.js)</strong></p>
  
  <pre><code>function TranslationRequestService(){
      var mongooseUtil = require('../../../utils/mongoose-util/mongoose-util');
      var TranslationRequest = mongooseUtil.getTranslationRequestModel();
      var _this = this;
  
      this.getTranslationResultById = function(id){
          return TranslationRequest.findOne({ _id: id })
              .populate('_translator', 'nickName avatarUrl')
              .exec();
      }
  }
  
  module.exports = new TranslationRequestService();
  </code></pre>
  
  <p><strong>(how the handler is being used)</strong></p>
  
  <pre><code>// following lines are executed twice by user's repeated action on UI
  var service = require('./translation-request-service);
  service.getTranslationResultById(id);
  </code></pre>