title: Simple mongoose example not working
body: <p>I am trying to run a simple mongoose/node example which I found here on stackoverflow:</p>
  
  <pre><code>var mongoose = require('mongoose'),
  db = mongoose.connect('mongodb://localhost/db'),
  Schema = mongoose.Schema;
  
  var sentinel = setTimeout(function(){
      throw "failed to connect to MongoDB after one minute!";
  }, 60*1000); // 60 seconds
  
  
  mongoose.model('User', new Schema({
      properties: {
          name    : { type: String, index: true }
      }
  }));    
  
  var User = db.model('User');
  
  var u = new User();
  u.name = 'Foo';
  u.save();
  
  User.find().all(function(arr) {
      clearTimeout(sentinel); // cancel the timeout sentinel
      console.log('Users found');
      console.log(arr);
      console.log('length='+arr.length);
  });
  
  process.stdin.resume();
  </code></pre>
  
  <p>If I get the code right there should be an output in the terminal at the end of the script, where the message "Users found" and all users from the collection should be printed. But I just get the timeout message. Why that?</p>
  
  <p>I am running my server on an Amazon EC2 micro instance. Node, Mongodb and mongoose are installed and a Mongodb server is running (I can interact with it from the terminal via "mongo"). I have also created the directory /data/db.</p>