I am running this code, but nothing is kept in Mongo. I access the Mongo and perform "db.test.find ()" but I get nothing. PS: No error is shown. I can insert an object from console performing "db.test.insert({...})" Does anyone know what is happening?
MongoDB: 2.6.4 Mongoose: 3.8.15
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('meow');
});
Thank you