title: Refer to a schema inside a class
body: <p>Users in my database are declared inside a class as follows:</p>
  
  <pre><code>class User {
      constructor() {
          this.user = mongoose.model('user', {
              email: String,
              name: String,
          })
      }
      validPassword(collection, password) {
          ... ...
      }
  }
  
  const user  = new User();
  module.exports = user;
  </code></pre>
  
  <p>In my <code>PostSchema</code>, I want <code>author</code> to point to the above Schema, but I don't know how to write the part after <code>ref:</code>. I tried <code>User</code>, it gave me an error <code>MongooseError: Schema hasn't been registered for model "User".</code></p>
  
  <pre><code>var PostSchema = new mongoose.Schema({
      title: { type: String, default: "DefaultTitle" },
      author: { type: mongoose.Schema.Types.ObjectId, ref: 'User' },
  })
  </code></pre>
  
  <p>Could anyone help?</p>