title: Express Mongoose Model.find() returns undefined
body: <p>Hej, have a problem. Trying to send Express response with Mongo data in it.
  <br><b>This is code from my Express server</b>    </p>
  
  <pre><code>var Task = require('./modules/Task');
  app.get('/get-all-tasks',function(req,res){
      res.setHeader('Content-Type', 'application/json');
      console.log(Task.getAllTasks()); // returns undefined
      res.json({msg:"Hej, this is a test"}); // returns object
  });
  </code></pre>
  
  <p><br><b>This is mongoose model in separate file</b> </p>
  
  <pre><code>var mongoose = require('mongoose');
  mongoose.connect('mongodb://localhost/todo-app');
  
  var TaskSchema =  mongoose.Schema({
      name: String,
      assignee: String
  },{ collection : 'task' });
  
  var Task = module.exports = mongoose.model('Task', TaskSchema);
  
  module.exports.createTask = function (newTask, callback) {
      newTask.save(callback);
  
  }
  
  module.exports.getAllTasks = function(){
          Task.find().lean().exec(function (err, docs) {
          console.log(docs); // returns json
      });
  }
  </code></pre>
  
  <p><b>How can I properly send data from getAllTasks function?</b></p>