The following is my code:
mongoose.connect(\'mongodb://localhost/mydatabase\');
var db = mongoose.connection;
db.on(\'error\', console.error.bind(console, \'co
Have you tried doing your query after the database connection opens? I don't have a Mongoose server to test it, but that would be my first guess.
var Stuff = mongoose.model('Stuff', StuffSchema);
db.once('open', function () {
Stuff.find({}, function (e, body) {
console.log('It worked!');
});
});
Sorry, if this doesn't end up fixing it.