title: Mongoose: calling static method of another schema returns "TypeError: Object has no method 'xxx' "
body: <p>In my node project, I have defined a dog schema and a cat schema. </p>
  
  <p>The schema are the same(name/age). </p>
  
  <p>Both schema have a static method <em>sayHello</em>. The cat schame has an instance method let_dog_speak which will trigger the <em>sayHello</em> of the Dog schema, so does the let_cat_speak.</p>
  
  <p>In my route handler, when I am trying to get a dog instance(/getdog/:name), the cat's <em>sayHello</em> method will be triggered, vice versa.</p>
  
  <p>The problem is my cat is able to let the dog speak while the dog cannot. I attached below my code and the error messages.</p>
  
  <p><strong>./model/cat.js</strong></p>
  
  <pre><code>var Dog = require('./dog');
  
  var Cat = new Schema({
      name: { type:String, required:true, trim:true },
      age: { type:Number, required:true, trim:true }
  });
  
  Cat.statics.sayHello = function() {
      console.log("Meow meow");
  };
  
  Cat.methods.let_dog_speak = function() {
      Dog.sayHello();
  };
  
  var cat_model = testdb.model('cat_collection', Cat);
  module.exports = cat_model;
  </code></pre>
  
  <p><strong>./model/dog.js</strong></p>
  
  <pre><code>var Cat = require('./cat');
  
  var Dog = new Schema({
      name: { type: String, required: true, trim: true },
      age: { type: Number, required:true, trim:true },
  });
  
  Dog.statics.sayHello = function() {
      console.log("Wow wow");
  };
  
  Dog.methods.let_cat_speak = function() {
      Cat.sayHello();
  };
  
  var dog_model = testdb.model('dog_collection', Dog);
  module.exports = dog_model;
  </code></pre>
  
  <p>Here is my route, <strong>./route.js</strong></p>
  
  <pre><code>app.get('/getdog/:name', function(req, res) {
      Dog.findOne({
          name: req.params.name
      }, function(error, dog) {
          dog.let_cat_speak(); //This throws error
          res.json(dog);
      });
  });
  
  app.get('/getcat/:name', function(req, res) {
      Cat.findOne({
          name: req.params.name,
      }, function(error, cat) {
          cat.let_dog_speak(); //This works, will print wow wow 
          res.json(cat);
      });
  });
  </code></pre>
  
  <p><strong>Error message:</strong></p>
  
  <pre><code>TypeError: Object #&lt;Object&gt; has no method 'sayHello'
      at model.Dog.methods.let_cat_speak (/home/sliter/Development/nodeJS/mongotest/backend/model/dog.js:16:9)
  </code></pre>