I have a small question.I try to run this code and why 5 is before "meow".I thought that reason is that speed of save Db is slower and try to add many operations after console.log(5),but "meow" was last too.
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
var Cat = mongoose.model('Cat', { name: String });
var kitty = new Cat({ name: 'Zildjian' });
kitty.save(function (err) {
if (err) {
console.log(err);
} else {
console.log('meow');
}
});
console.log(5);